Skip to content

v2.17.0

Compare
Choose a tag to compare
@Pierre-Sassoulas Pierre-Sassoulas released this 08 Mar 11:39
· 875 commits to main since this release

2.17 is a small release that is the first to support python 3.11 officially
with the addition of TryStar nodes.

There's still two new default checks: bad-chained-comparison and
implicit-flag-alias, one of them already fixed a previously undetected
bug in sentry.

Thanks to the community effort our documentation is almost complete,
and almost all messages should have a proper documentation now.
A big thank you to everyone who participated !

The next release is going to be 3.0.0, bring breaking changes and
enact long announced deprecations. There's going to be frequent beta
releases, before the official releases, everyone is welcome to try the betas
so we find problems before the actual release.

What's new in Pylint 2.17.0?

Release date: 2023-03-08

New Features

  • pyreverse now supports custom color palettes with the --color-palette
    option.

    Closes #6738

  • Add invalid-name check for TypeAlias names.

    Closes #7081

  • Accept values of the form <class name>.<attribute name> for the
    exclude-protected list.

    Closes #7343

  • Add --version option to pyreverse.

    Refs #7851

  • Adds new functionality with preferred-modules configuration to detect
    submodules.

    Refs #7957

  • Support implicit namespace packages (PEP 420).

    Closes #8154

  • Add globbing pattern support for --source-roots.

    Closes #8290

  • Support globbing pattern when defining which file/directory/module to lint.

    Closes #8310

  • pylint now supports TryStar nodes from Python 3.11 and should be fully
    compatible with Python 3.11.

    Closes #8387

New Checks

  • Add a bad-chained-comparison check that emits a warning when
    there is a chained comparison where one expression is semantically
    incompatible with the other.

    Closes #6559

  • Adds an implicit-flag-alias check that emits a warning when a class
    derived from enum.IntFlag assigns distinct integer values that share
    common bit positions.

    Refs #8102

False Positives Fixed

  • Fix various false positives for functions that return directly from
    structural pattern matching cases.

    Closes #5288

  • Fix false positive for used-before-assignment when
    typing.TYPE_CHECKING is used with if/elif/else blocks.

    Closes #7574

  • Fix false positive for isinstance-second-argument-not-valid-type with union
    types.

    Closes #8205

  • Fix false positive for used-before-assignment for named expressions
    appearing after the first element in a list, tuple, or set.

    Closes #8252

  • Fix false positive for wrong-spelling-in-comment with class names in a
    python 2 type comment.

    Closes #8370

False Negatives Fixed

  • Fix a false negative for 'missing-parentheses-for-call-in-test' when
    inference
    failed for the internal of the call as we did not need that information to
    raise
    correctly.

    Refs #8185

  • Fix false negative for inconsistent-returns with while-loops.

    Closes #8280

Other Bug Fixes

  • Fix used-before-assignment false positive when the walrus operator
    is used with a ternary operator in dictionary key/value initialization.

    Closes #8125

  • Fix no-name-in-module false positive raised when a package defines a
    variable with the
    same name as one of its submodules.

    Closes #8148

  • Fix a crash happening for python interpreter < 3.9 following a failed typing
    update.

    Closes #8161

  • Fix nested-min-max suggestion message to indicate it's possible to splat
    iterable objects.

    Closes #8168

  • Fix a crash happening when a class attribute was negated in the start
    argument of an enumerate.

    Closes #8207

  • Prevent emitting invalid-name for the line on which a global
    statement is declared.

    Closes #8307

Other Changes

  • Update explanation for global-variable-not-assigned and add confidence.

    Closes #5073

  • The governance model and the path to become a maintainer have been documented
    as part of our effort to guarantee that the software supply chain in which pylint is included is secure.

    Refs #8329