github dosisod/refurb v1.3.0
Version 1.3.0

latest releases: v2.0.0, v1.28.0, v1.27.0...
2 years ago

This release includes a lot of bug fixes, documentation improvements, the --enable flag, and a new check!

The --enable flag

This allows for enabling checks which are disabled by default. There are currently no built-in checks which are disabled, but checks in plugins (or future built-in checks) might be disabled by default, and will require you to opt in via --enable.

You can also use this via the enable field in the pyproject.toml file.

The "no del" check

This check warns about the use of a del statement which could be rewritten using .pop()/.clear() instead:

For example, this:

nums = [1, 2, 3]

del nums[0]
del nums[:]

Is suggested to be changed to:

nums = [1, 2, 3]

nums.pop(0)
nums.clear()

What's Changed

  • Require len() comparison check to only operate within if statements by @dosisod in #32
  • Simplify error code naming system by @dosisod in #33
  • Fix incorrect error message for dict/list for FURB123 by @dosisod in #36
  • Simplify mypy config by @michaeloliverx in #27
  • Add ability to enable/disable checks by @dosisod in #41
  • Use utf8 locale when reading files by @dosisod in #43
  • Fix "with suppress" check giving incorrect message for multiple exceptions by @dosisod in #48
  • Cleanup the "in tuple" check by @dosisod in #49
  • Add "no del" check by @dosisod in #50
  • Update Documentation, Bump Version by @dosisod in #51

New Contributors

Full Changelog: v1.2.0...v1.3.0

Don't miss a new refurb release

NewReleases is sending notifications on new releases.