What's New in Pylint 2.2¶
- Release
2.2
- Date
2018-11-25
Summary -- Release highlights¶
New checkers¶
String checker now reports format string type mismatches.
duplicate-string-formatting-argumentwas added for detecting duplicate string formatting arguments that should be passed instead as named arguments.logging-format-styleis a new option for the logging checker for usage of str.format() style format strings in calls to loggers.It accepts two options:
--logging-format-style=oldfor using % style formatting, which is the assumed default, and--logging-format-style=newfor using {} style formatting.implicit-str-concat-in-sequencedetects string concatenation inside lists, sets & tuples.Example of code that would generate such warning:
woops = ('a', 'b' 'c')
Other Changes¶
try-except-raisechecker now handles multilevel inheritance hirerachy for exceptions correctly.Close #2484
Ignore import x.y.z as z cases for checker
useless-import-alias.unnecessary-passis now also emitted when a function or class contains only docstring and pass statement, in which case, docstring is enough for empty definition.Fix false positive
undefined-variableandused-before-assignmentwith nonlocal keyword usage.Fix exceptions being raised when one of the params is not a ClassDef for
checkers.utils.is_subclass_of().pylintnow picks the latest value from the inferred values of the exception that gets raised, when looking forraising-non-exception. This helps when reusing a variable name for multiple types, sincepylintwas picking just the first inferred value, leading to spurious false positives.Close #2431
pylintused to emit anot-an-iterableerror when looking at coroutines built withasyncio.coroutine. This is no longer the case as we handle coroutines explicitly.Close #996
pylintused to emit anunused-variableerror if unused import was found in the function. Now instead ofunused-variable,unused-importis emitted.Close #2421
