2019-10-07 05:37:34 +00:00
***** ***** ***** ***** ***** *
What's New in Pylint 2.5
***** ***** ***** ***** ***** *
:Release: 2.5
:Date: TBC
Summary -- Release highlights
=============================
New checkers
============
2019-10-16 10:20:31 +00:00
* A new check `` f-string-without-interpolation `` was added.
This check is emitted whenever **pylint** detects the use of an
f-string without having any interpolated values in it, which means
that the f-string can be a normal string.
2019-11-27 15:03:28 +00:00
* Multiple checks for invalid return types of protocol functions were added:
* `` invalid-bool-returned `` : `` __bool__ `` did not return a bool
* `` invalid-index-returned `` : `` __index__ `` did not return an integer
* `` invalid-repr-returned) `` : `` __repr__ `` did not return a string
* `` invalid-str-returned) `` : `` __str__ `` did not return a string
* `` invalid-bytes-returned) `` : `` __bytes__ `` did not return a string
* `` invalid-hash-returned) `` : `` __hash__ `` did not return an integer
* `` invalid-length-hint-returned) `` : `` __length_hint__ `` did not return a non-negative integer
* `` invalid-format-returned) `` : `` __format__ `` did not return a string
* `` invalid-getnewargs-returned) `` : `` __getnewargs__ `` did not return a tuple
* `` invalid-getnewargs-ex-returned) `` : `` __getnewargs_ex__ `` did not return a tuple of the form (tuple, dict)
2019-10-07 05:37:34 +00:00
Other Changes
=============
2019-11-19 08:16:54 +00:00
* Don't emit `` line-too-long `` for multilines when a
`pylint:disable=line-too-long` comment stands at their end.
For example the following code will not trigger any `` line-too-long `` message::
def example():
"""
This is a very very very long line within a docstring that should trigger a pylint C0301 error line-too-long
Even spread on multiple lines, the disable command is still effective on very very very, maybe too much long docstring
"""#pylint: disable=line-too-long
pass
2019-10-07 05:37:34 +00:00
* Configuration can be read from a setup.cfg or pyproject.toml file
in the current directory.
A setup.cfg must prepend pylintrc section names with `` pylint. `` ,
for example `` [pylint.MESSAGES CONTROL] `` .
A pyproject.toml file must prepend section names with `` tool.pylint. `` ,
for example `` [tool.pylint.'MESSAGES CONTROL'] `` .
These files can also be passed in on the command line.
2019-10-16 19:11:35 +00:00
2019-10-30 09:06:19 +00:00
* Add new good-names-rgx and bad-names-rgx to enable white-/blacklisting of regular expressions
To enable better handling of whitelisting/blacklisting names, we added two new config options: good-names-rgxs: a comma-
separated list of regexes, that if a name matches will be exempt of naming-checking. bad-names-rgxs: a comma-
separated list of regexes, that if a name matches will be always marked as a blacklisted name.
2019-10-16 19:11:35 +00:00
* Mutable `` collections.* `` are now flagged as dangerous defaults.
2019-11-21 08:07:25 +00:00
* Add new --fail-under flag for setting the threshold for the score to fail overall tests. If the score is over the fail-under threshold, pylint will complete SystemExit with value 0 to indicate no errors.