Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release branch 3.0.0 #9093

Merged

Conversation

Pierre-Sassoulas
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas commented Oct 2, 2023

What's new in Pylint 3.0.0?

Release date: 2023-10-02

Breaking Changes

Changes requiring user actions

  • The invalid-name message no longer checks for a minimum length of 3 characters by default.
    (This was an unadvertised commingling of concerns between casing
    and name length, and users regularly reported this to be surprising.)

    If checking for a minimum length is still desired, it can be regained in two ways:

    • If you are content with a disallowed-name message (instead of
      invalid-name), then simply add the option bad-names-rgxs="^..?$",
      which will fail 1-2 character-long names. (Ensure you enable
      disallowed-name.)

    • If you would prefer an invalid-name message to be emitted, or would
      prefer finer-grained control over the circumstances in which messages are
      emitted (classes vs. methods, etc.), then avail yourself of the regex
      options described
      here <https://pylint.readthedocs.io/en/stable/user_guide/configuration/all-options.html#main-checker>.
      (In particular, take note of the commented out options in the "example
      configuration" given at the bottom of the section.) The prior regexes can
      be found in the
      pull request <https://github.com/pylint-dev/pylint/pull/8813>

      that removed the length requirements.

    Closes Show why snake_case errors is emitted on single word variables (might be too small) #2018

  • The compare to empty string checker (pylint.extensions.emptystring) and the compare to
    zero checker (pylint.extensions.compare-to-zero) have been removed and their checks are
    now part of the implicit booleaness checker:

    • compare-to-zero was renamed use-implicit-booleaness-not-comparison-to-zero and
      compare-to-empty-string was renamed use-implicit-booleaness-not-comparison-to-string
      and they now need to be enabled explicitly.

    • The pylint.extensions.emptystring and pylint.extensions.compare-to-zero extensions
      no longer exist and need to be removed from the load-plugins option.

    • Messages related to implicit booleaness were made more explicit and actionable.
      This permits to make their likeness explicit and will provide better performance as they
      share most of their conditions to be raised.

    Closes Uniformize compare-to-zero, compare-to-empty-string with the use-implicit-booleaness-x checks #6871

  • epylint was removed. It now lives at: https://github.com/emacsorphanage/pylint.

    Refs Please consider maintaining the Emacs-Lisp files in a separate repository #7737

  • The overgeneral-exceptions option now only takes fully qualified names
    into account (builtins.Exception not Exception). If you overrode
    this option, you need to use the fully qualified name now.

    There's still a warning, but it will be removed in 3.1.0.

    Refs [overgeneral-exceptions] Only handle qualified names #8411

  • Following a deprecation period, it's no longer possible to use MASTER
    or master as configuration section in setup.cfg or tox.ini. It's bad practice
    to not start a section title with the tool name. Please use pylint.main instead.

    Refs [deprecation] setup.cfgand tox.ini sections need to start by 'pylint' #8465

  • Package stats are now printed when running Pyreverse and a --verbose flag was added to get the original output with parsed modules. You might need to activate the verbose option if you want to keep the old output.

    Closes More useful printing for Pyreverse #8973

New Features

New Checks

Extensions

  • Add new prefer-typing-namedtuple message to the CodeStyleChecker to suggest
    rewriting calls to collections.namedtuple as classes inheriting from typing.NamedTuple
    on Python 3.6+.

    Requires load-plugins=pylint.extensions.code_style and enable=prefer-typing-namedtuple to be raised.

    Closes Discourage collections.namedtuple in favor of typing.NamedTuple #8660

False Positives Fixed

False Negatives Fixed

Other Bug Fixes

Other Changes

Internal Changes

Performance Improvements

Closes #7607

@Pierre-Sassoulas Pierre-Sassoulas added Blocked 🚧 Blocked by a particular issue Maintenance Discussion or action around maintaining pylint or the dev workflow Skip news 🔇 This change does not require a changelog entry labels Oct 2, 2023
@Pierre-Sassoulas Pierre-Sassoulas added this to the 3.0.0 milestone Oct 2, 2023
@Pierre-Sassoulas Pierre-Sassoulas self-assigned this Oct 2, 2023
@Pierre-Sassoulas
Copy link
Member Author

Blocked by #9092

@Pierre-Sassoulas
Copy link
Member Author

Maybe not blocked, the github CI are not ready yet.

@Pierre-Sassoulas Pierre-Sassoulas removed the Blocked 🚧 Blocked by a particular issue label Oct 2, 2023
@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

Merging #9093 (c61edea) into main (3cba15b) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9093   +/-   ##
=======================================
  Coverage   95.75%   95.75%           
=======================================
  Files         173      173           
  Lines       18663    18663           
=======================================
  Hits        17871    17871           
  Misses        792      792           
Files Coverage Δ
pylint/__pkginfo__.py 100.00% <100.00%> (ø)

This long anticipated major version also provides some important usability
and performance improvements, along with enacting necessary breaking changes
and long-announced deprecations. The documentation of each message with an
example is very close too.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyreverse also got a lot of love but hard to pinpoint a particular issues that was super important compared to the others.

@cdce8p
Copy link
Member

cdce8p commented Oct 2, 2023

Blocked by #9092

Maybe not blocked, the github CI are not ready yet.

It'll probably take a day or two until 3.12.0 is available for Github CI runs. You can follow the releases here https://github.com/actions/python-versions

@Pierre-Sassoulas Pierre-Sassoulas merged commit 0335711 into pylint-dev:main Oct 2, 2023
42 checks passed
@Pierre-Sassoulas Pierre-Sassoulas deleted the release-branch-3.0.0 branch October 2, 2023 17:19
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2023

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit c61edea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment