*************************** What's New in Pylint 4.0 *************************** .. toctree:: :maxdepth: 2 :Release:4.0 :Date: TBA Summary -- Release highlights ============================= .. towncrier release notes start What's new in Pylint 4.0.0? --------------------------- Release date: TBA Breaking Changes ---------------- - Commented out code blocks such as ``# bar() # TODO: remove dead code`` will no longer emit ``fixme``. Refs #9255 (`#9255 `_) - `pyreverse` `Run` was changed to no longer call `sys.exit()` in its `__init__`. You should now call `Run(args).run()` which will return the exit code instead. Having a class that always raised a `SystemExit` exception was considered a bug. Normal usage of pyreverse through the CLI will not be affected by this change. Refs #9689 (`#9689 `_) - The ``async.py`` checker module has been renamed to ``async_checker.py`` since ``async`` is a Python keyword and cannot be imported directly. This allows for better testing and extensibility of the async checker functionality. Refs #10071 (`#10071 `_) New Features ------------ - The `fixme` check can now search through docstrings as well as comments, by using ``check-fixme-in-docstring = true`` in the ``[tool.pylint.miscellaneous]`` section. Closes #9255 (`#9255 `_) False Positives Fixed --------------------- - Fix a false positive for `used-before-assignment` when a variable defined under an `if` and via a named expression (walrus operator) is used later when guarded under the same `if` test. Closes #10061 (`#10061 `_) - Fix a false positive for `use-implicit-booleaness-not-len`. No lint should be emitted for generators (`len` is not defined for generators). Refs #10100 (`#10100 `_) False Negatives Fixed --------------------- - Fix false negative for `used-before-assignment` when a `TYPE_CHECKING` import is used as a type annotation prior to erroneous usage. Refs #8893 (`#8893 `_) - Fix false negative for `used-before-assignment` when a function is defined inside a `TYPE_CHECKING` guard block and used later. Closes #10028 (`#10028 `_)