Version 1.15.0
This version adds 3 new checks!
Add use-long-regex-flag
check (FURB167)
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-isinstance-type-none
(FURB168)
Checking if an object is None
using isinstance()
is un-pythonic: use an is
comparison instead.
Bad:
x = 123
if isinstance(x, type(None)):
pass
Good:
x = 123
if x is None:
pass
Add no-is-type-none
check (FURB169)
Don't use type(None)
to check if the type of an object is None
, use an is
comparison instead.
Bad:
x = 123
if type(x) is type(None):
pass
Good:
x = 123
if x is None:
pass
What's Changed
- Allow for extracting line/column info from nodes by @dosisod in #233
- Bump packages, cleanup
pyproject.toml
by @dosisod in #235 - Add
use-long-regex-flag
check by @dosisod in #236 - Remove
pre-commit
shell script, cleanup coverage output by @dosisod in #237 - Remove part of FURB131: by @dosisod in #239
- Add
rstrip
andstrip
support to FURB139 by @dosisod in #240 - Add
no-isinstance-type-none
check by @dosisod in #241 - Add
no-is-type-none
check by @dosisod in #242 - Bump version by @dosisod in #243
Full Changelog: v1.14.0...v1.15.0