This version adds a few new checks (and fixes a few bugs).
Add use-long-regex-flag
check (FURB170)
Regex operations can be changed using flags such as re.I
, which will make the regex case-insensitive. These single-character flag names can be harder to read/remember, and should be replaced with the longer aliases so that they are more descriptive.
Bad:
if re.match("^hello", "hello world", re.I):
pass
Good:
if re.match("^hello", "hello world", re.IGNORECASE):
pass
Add no-single-item-in
check (FURB171)
Don't use in
to check against a single value, use ==
instead:
Bad:
if name in ("bob",):
pass
Good:
if name == "bob":
pass
What's Changed
- Add
use-regex-pattern-methods
check by @dosisod in #244 - Bump packages by @dosisod in #245
- Enable more
ruff
checks by @dosisod in #247 - Fix settings from config file getting overridden by command line args by @dosisod in #249
- Add
no-single-item-in
check by @dosisod in #250
Full Changelog: v1.15.0...v1.16.0