What's Changed
See the release blog post for more, including detailed descriptions of any newly added rules.
New rules
- [
flake8-pyi
] ImplementPYI018
by @LaBatata101 in #6018 - [
flake8-pyi
] ImplementPYI047
by @LaBatata101 in #6134 - [
flake8-pyi
] ImplementPYI049
by @LaBatata101 in #6136 - [
flake8-pyi
] ImplementPYI056
by @LaBatata101 in #5959 - [
flake8-pyi
] ImplementPYI046
by @LaBatata101 in #6098 - [
flake8-use-pathlib
] Implementglob
(PTH207
) by @sbrugman in #5939 - [
flake8-use-pathlib
] Implementos-sep-split
(PTH206
) by @sbrugman in #5936 - [
pycodestyle
] ImplementE241
andE242
(tab/multiple ws after commas) by @akx in #6094 - [
pylint
] Implementself-assigning-variable
(W0127
) by @tjkuson in #6015 - [
pylint
] Implementeq-without-hash
rule (PLW1641) by @jelly in #5955 - [
pylint
] Implementsubprocess-popen-preexec-fn
(W1509
) by @tjkuson in #5978
Rule changes
- [
flake8-bugbear
] ExtendsB002
to detect unary prefix decrement operators by @tjkuson in #5998 - [
flake8-pytest-style
] Avoid raising PT012 for simplewith
statements by @harupy in #6081 - [
flake8-pytest-style
] Allow pytest.raises body to contain a single func or class definition by @harupy in #6083 - [
flake8-simplify
] Extend SIM118 withnot in
by @sbrugman in #5995 - [
perflint
] SkipPERF203
violations for multi-statement loops by @charliermarsh in #6145 - [
pyupgrade
] Add support forint
,float
,bool
inUP018
by @dhruvmanila in #6013 - [
tryceratops
] Add suggested fix forTRY201
by @dhruvmanila in #6008
Settings
- Allow specification of
logging.Logger
re-exports vialogger-objects
by @charliermarsh in #5750 - Set default
max-complexity
to 10 for empty McCabe settings by @charliermarsh in #6073 - [
pep8-naming
]: New config optionextend-ignore-names
by @dhruvmanila in #6169
Bug Fixes
- Avoid raising
UP032
ifformat
call arguments contain multiline expressions by @harupy in #5971 - Fix
F507
false positive by @harupy in #5986 - Fix logging rules with whitespace around dot by @charliermarsh in #6022
- Ignore end-of-line comments when dirtying if-with-same-arms branches by @charliermarsh in #6031
- Avoid treating
Literal
members as expressions with__future__
by @charliermarsh in #6032 - Avoid refactoring
x[:1]
-like slices in RUF015 by @charliermarsh in #6150 - Avoid key-in-dict violations for
self
accesses by @charliermarsh in #6165 - Avoid falsely marking non-submodules as submodule aliases by @charliermarsh in #6182
- Flag
[
as an invalid noqa suffix by @charliermarsh in #5982 - Ignore some common builtin overrides on standard library subclasses by @charliermarsh in #6074
- Avoid A003 violations for explicitly overridden methods by @charliermarsh in #6076
- Include file permissions in key for cached files by @zanieb in #5901
- Ignore
explicit-string-concatenation
on single line by @tjkuson in #6028 - Fix
SIM102
to handle indentedelif
by @harupy in #6072 - Raise
PTH201
forPath("")
by @harupy in #6095 - Update
SIM115
to coverpathlib.Path.open
by @harupy in #611 - Ignore end-of-line file exemption comments by @charliermarsh in #6160
- Implement
--diff
for Jupyter Notebooks by @dhruvmanila in #6149 - Skip BOM when determining Locator's line starts by @charliermarsh in #6159
- Avoid parenthesizing comprehension element by @dhruvmanila in #6198
- Do not raise
SIM105
for non-exceptions by @sbrugman in #5985
New Contributors
- @AlexWaygood made their first contribution in #5973
- @RMPR made their first contribution in #6048
- @arembridge made their first contribution in #6079
- @Eutropios made their first contribution in #6082
- @jelly made their first contribution in #5955
Full Changelog: v0.0.280...v0.0.281