summaryrefslogtreecommitdiff
path: root/doc/whatsnew
Commit message (Collapse)AuthorAgeFilesLines
* Make ``self-cls-assignment`` check tuple assignment (#5268)Daniël van Noord2021-11-071-0/+2
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Fix crash on checking private members on ``__class__``Daniël van Noord2021-11-051-0/+4
| | | | Closes #5261
* Inspection for `with threading.Lock():` (#5245)Martin2021-11-031-0/+4
| | | | | | | | | | | | | | | | | | | Using `with threading.Lock():` directly has no effect. Correct usage is: ``` lock = threading.Lock() with lock: ... ``` This applies for: * threading.Lock * threading.RLock * threading.Condition * threading.Semaphore * threading.BoundedSemaphore Signed-off-by: Martin Basti <mbasti@redhat.com>
* Use single worker if importing `multiprocessing.synchronize` fails (#5238)Harshil2021-11-031-0/+5
| | | | | * add test import for multiprocessing.synchronize Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* add changelog and contributor entryAntonio Quarta2021-10-311-0/+2
|
* Fix ``protected-access`` for attributes and methods of nested classes (#5232)Daniël van Noord2021-10-311-0/+4
| | | | | | | | | | | | | | | * Fix access to private function in inner class on protected-access bug * Add functional test for protected-access from inner class * Add Ikraduya to CONTRIBUTORS file * Add if statement to avoid potential bug * Fix ``protected-access`` for attributes and methods of nested classes This closes #3066 Co-authored-by: ikraduya <ikraduya@gmail.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Allow no type in Numpy param docstrings for ``mising-param-doc`` (#5231)Daniël van Noord2021-10-311-0/+5
| | | | | This closes #5222 See https://numpydoc.readthedocs.io/en/latest/format.html#parameters for reference
* Fix incorrect ``consider-using-ternary`` when condition is inferable as ↵Arianna Y2021-10-291-0/+4
| | | | | | | False (#5227) * Fix incorrect ``consider-using-ternary`` when condition is inferrable as False * Properly infer the condition in old ternary statements and suggest ``simplify-boolean-expression`` over ``consider-using-ternary`` if it is False
* Fix exception of pyreverse in handling property function within a class.Takahide Nojima2021-10-261-0/+2
|
* Add control flow check for ``undefined-variable`` in ``if ... else``Daniël van Noord2021-10-261-0/+6
| | | | Closes #3688
* Add configuration option ``exclude-too-few-public-methods`` (#5191)Mike Fiedler2021-10-261-0/+5
| | | | | | | | | Allow excluding classes based on their ancestors from the ``too-few-public-methods`` checker. Closes #3370 Signed-off-by: Mike Fiedler <miketheman@gmail.com> Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Add tests for assignment expressions in function defaults (#5188)Daniël van Noord2021-10-251-0/+5
| | | | | | | | | * Add tests for assignment expressions in function defaults Ref #3688 * Upgrade astroid to 2.8.4 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add ``mixin-class-rgx`` option (#5203)Daniël van Noord2021-10-251-0/+2
| | | | | Co-authored-by: Alpha <alpha@pokesplash.net> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add extension checker that suggests any/all statements from for loops (#5196)Arianna Y2021-10-251-0/+4
| | | | | | | | | * Add extension checker that suggests any/all statements from for loops * Suggest all/not all: If there are negated conditions, we can suggest an all/not all statement to move the 'not' out of the comprehension and call it only once. Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Normalize input of ``ignore-paths`` for all path types (#5201)Daniël van Noord2021-10-241-0/+5
| | | | | Closes #5194 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Make ``used-before-assignment`` consider classes in method annotation and ↵Daniël van Noord2021-10-231-0/+5
| | | | | | | | | defaults (#5184) This closes #3771 Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix useless-super-delegation false positive when default keyword argument is ↵Nick Pesce2021-10-191-0/+2
| | | | | | | a variable. (#5157) Compare variable default args and simplify the logic of the checkers. Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix double emitting of ``not-callable`` on inferrable ``properties``Daniël van Noord2021-10-191-0/+4
| | | | Closes #4426
* Fix asterisks parsing of ``mising-param-doc`` (#5175)Daniël van Noord2021-10-181-0/+5
| | | Closes #3733
* Make ``undefined-variable`` check line numbers of metaclass parametersDaniël van Noord2021-10-181-0/+5
|
* Add a warning ``use-implicit-booleaness-not-comparison`` for comparison with ↵Jaehoon Hwang2021-10-171-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | collection literals (#5120) * Create a new checker; use-implicit-booleanness checker where it looks for boolean evaluatiion with collection literals such as `()`, `[]`, or `{}` * Fixed invalid usage of comparison within pylint package This closes #4774 * Ignore tuples when checking for `literal-comparison` Closes #3031 * Merge len_checker with empty_literal checker Moving empty literal checker with len_checker to avoid class without iterators without boolean expressions (false positive on pandas) Reference: https://github.com/PyCQA/pylint/pull/3821/files * Update `len_checker` and its class `LenChecker` to `ComparisonChecker` to reflect better usage after merging between `len_checker` and `empty_literal_checker` and its tests. * Fixed `consider_using_in` and `consider_iterating_dictionary` tests that were failing due to new empty literal checkers. Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Make ``undefined-variable`` flag type annotation without value assignment ↵Daniël van Noord2021-10-151-0/+5
| | | | | | | (#5158) Closes #5140 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Create new ``UnsupportedVersionChecker`` checker class (#5148)Daniël van Noord2021-10-131-2/+5
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Add ``using-f-string-in-unsupported-version`` checker (#5139)Daniël van Noord2021-10-111-0/+3
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Properly identify undocumented parameters and add new message called ↵Konstantina Saketou2021-10-101-0/+7
| | | | | | | | | | | | | | | | | | | missing-any-param-doc (#5097) * Correctly identify parameters with no doc and add new message This commit fixes the problem where non documented parameters where not being identified properly. Also, it adds a new message called ``missing-any-param-doc`` for when a function has no parameter and type doc at all. Adds new test cases for the ``missing-param-doc`` and ``missing-type-doc`` messages and tests for the new message ``missing-any-param-doc``. * Replace old messages with the new one where needed Fix pylint's code where the new message where needed in other files instead of triggering both missing-param-doc and missing-type-doc. Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add checkers for typing.final for Python version 3.8 or later (#5133)Mark Byrne2021-10-101-0/+8
| | | | | | | | * Add checkers for typing.final for Python version 3.8 or later - overridden-final-method - subclassed-final-class Closes #3197
* Rename `len-as-condition` to `use-implicit-booleaness-not-len` (#5132)Jaehoon Hwang2021-10-101-0/+4
| | | | | | | | | | Rename `len-as-condition` to be more general for new checker `use-implicit-booleaness-not-comparison` * Refactor `LenChecker` class -> `ImplicitBooleanessChecker`o * Rename test files/`len_checker.py`/`__init__.py` to reflect new name. * Add `len-as-condition` as `old_names` for `use-implicit-booleaness-not-len` Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Improve and flatten ``unused-wildcard-import`` message (#5110)Daniël van Noord2021-10-041-0/+4
| | | | | | | | | * Improve and flatten ``unused-wildcard-import`` message Instead of reporting all unused imports, the checker now emits one single message for all unused imports with a stylized string containing all imports. This closes #3859 * Add tests for string formation
* Add ``flynt`` to 2.11 changelogDaniël van Noord2021-09-171-1/+2
|
* Spelling and grammar fixesVille Skyttä2021-09-172-3/+3
|
* Move back to a dev version following 2.11.0 releasePierre Sassoulas2021-09-162-0/+26
|
* Bump pylint to 2.11.0, update changelogv2.11.0Pierre Sassoulas2021-09-162-3/+29
|
* Fix false positive ``unused-private-member`` for accessing attributes in a ↵yushao22021-09-141-0/+4
| | | | | | | | class using ``cls`` (#4965) * Fix false positive ``unused-private-member`` for accessing attributes in a class using ``cls`` Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Make consider-iterating-dictionary consider membership check (#4997)Daniël van Noord2021-09-141-0/+4
|
* Make ``global-variable-not-assigned`` check local scope (#4990)Daniël van Noord2021-09-111-0/+6
| | | | | | | | | | | | * Make ``global-variable-not-assigned`` check local scope This checker now checks whether the names after the global keyword are reassigned in the local scope. This closes #1375 * Make ``global-variable-not-assigned`` check functions This checker now also checks function defintions in the module and local scope This closes #330 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix bug with cache's parent directory not existing (#4988)Daniël van Noord2021-09-101-0/+4
| | | | | | By changing the function used to create the cache from ``os.mkdir`` to ``os.makedirs`` we now handle non-existing parent directories correctly. This closes #4900
* Make ``min-similarity-lines == 0`` stop similarity check (#4970)Daniël van Noord2021-09-071-0/+4
| | | | | | | | * Make ``min-similarity-lines == 0`` stop similarity check This makes it so that setting ``min-similarity-lines`` to zero exit the similarity code checker with a successful exit. This closes #4901 Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Extend consider-using-in for attribute accessMarc Mueller2021-09-051-0/+2
|
* Fix false positive ``superfluous-parens`` for tuplesDaniël van Noord2021-09-011-0/+4
| | | | | | Tuples can be created with inner tuples. This creates double parenthesis which we flagged incorrectly. This closes #4907
* Extend ``unspecified-encoding`` checkerDaniël van Noord2021-09-011-0/+5
| | | | | | The ``unspecified-encoding`` checker now also checks calls to ``pathlib.Path().read_text()`` and ``pathlib.Path().write_text()`` This closes #4945
* Remove the python3 porting mode from the codebasePierre Sassoulas2021-09-011-0/+5
| | | | | | It's possible to use the python3 porting checker from an older pylint version. But it's not evolving anymore and was costing resource to maintain.
* Fix false positive `dict-iter-missing-items` for tuple keys (#4939)Daniël van Noord2021-08-311-0/+4
| | | | | | This fixes a false positive emitted for dictionaries that contain only tuples as keys. This makes unpacking the dictionary without calling `.items()` valid. This closes #3283
* Fix false positive ``protected-access`` in typing (#4937)Daniël van Noord2021-08-312-5/+8
| | | | | | | | * Fix false positive ``protected-access`` in typing Class functions can return protected members which can then be passed as arguments to other functions. When using type hints in function definitions these raised a message which they shouldn't do.
* Fix false positive for `function-redefined` for simple type annotationsDaniël van Noord2021-08-311-0/+4
| | | | Closes #4936
* Emit a correct invalid-name message when using multi-naming style. (#4924)Yilei "Dolee" Yang2021-08-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | * Emit a correct invalid-name message when using multi-naming style. Previously, given `--function-rgx=(?:(?P<UP>[A-Z]+)|(?P<down>[a-z]+))$` and the code: ``` def FOO(): pass def UPPER(): pass def lower(): pass ``` It would emit a message: ``Function name `lower` doesn't conform to '(?:(?P<UP>[A-Z]+)|(?P<down>[a-z]+))$' pattern [invalid-name]``. The message is misleading as `lower` *does* conform to `(?:(?P<UP>[A-Z]+)|(?P<down>[a-z]+))$`. It's just not the prevalent group "UP". After this commit, the message becomes: ``Function name `lower` doesn't conform to UP group in the '(?:(?P<UP>[A-Z]+)|(?P<down>[a-z]+))$' pattern [invalid-name]`` Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add `use-set-for-membership` check (#4841)Marc Mueller2021-08-301-0/+7
| | | | | | | | | * Add use-set-for-membership check * Create SetMembershipChecker extension * Add heuristic to check items for hashability Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add `consider-using-assignment-expr` to `CodeStyleChecker` (#4876)Marc Mueller2021-08-301-0/+10
| | | | | | | | | | | * Add global py-version config * Add typing-extensions as requirement for Python < 3.10 * Add consider-using-assignment-expr to CodeStyleChecker * Default to max-line-length Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Implement basic control flow checks for ``consider-using-with`` (#4929)Andreas Finkler2021-08-301-0/+3
| | | | | | | * Add some control flow checks to consider-using-with in order to handle assignments in different branches * Use existing function from ``astroid`` to determine whether two statements are exclusive * Add unit tests for new utility methods * Add ChangeLog and whatsnew entry
* Add ``Consider-using-f-string`` checker (#4796)Daniël van Noord2021-08-301-0/+4
| | | | | | | | | | | | | | | | * Add ``consider-using-f-string`` checker This adds a checker for normal strings which are formatted with ``.format()`` or '%'. The message is a convention to nudge users towards using f-strings. This closes #3592 * Update pylint code to use f-strings After adding `consider-using-f-strings` the codebase showed numerous cases of formatting which could be f-strings. This commit changes most of these to become f-strings, or adds ignores. * Apply suggestions from code review Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Move back to a dev version following 2.10.0 releasePierre Sassoulas2021-08-202-0/+22
|