| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix assigning-non-slot false positive with setattr
Previously, if a class was slotted and overrode `__setattr__`,
`assigning-non-slot` would be issued when assigning to attributes. With
`__setattr__` defined, we cannot infer if it is an error to assign to an
attribute, so we suppress the error.
Fix #3793
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
|
|
|
|
| |
decorator (#5412)
* Fix #5371: Correctly count arguments to static methods missing @staticmethod decorator
* Implementations of MapReduceMixin.reduce_map_data were actually not classmethods
|
| |
|
|
|
|
| |
* Activate and fix existing use-set-for-membership checks
|
|
|
|
| |
Closes #5250
|
|
|
|
|
|
|
|
|
|
| |
* Fix a crash in the ``check_elif`` extensions where an undetected if in a comprehension
with an if statement within a f-string resulted in an out of range error. The checker no
longer relies on counting if statements anymore and uses known if statements locations instead.
It should not crash on badly parsed if statements anymore. specify the confidence of the message
* Remove disable for else-if-used in pylint/checkers/classes.py
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
|
|
|
|
|
| |
* Fix crash for ``protected-access`` on (outer)-class traversal
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add checker `using-final-in-unsupported-version`
This is one of the tasks in issue: #5134
Also:
- Ensure the existing checkers for `typing.final` are used irrespective of Python
version
* Emit `using-final-in-unsupported-version` warning when Python version < 3.8
and none of the other `typing.final`-related warnings
* Add `uninferable_final_decorators`
Return any `typing.final` decorators for a given `Decorators` node.
Used to determine if this decorator is used with a version of Python in
which it is unsupported.
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
| |
Closes #5261
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Clean up some useless-super-delegation logic
In _definition_equivalent_to_call, avoid constructing a tuple and
calling "all" on that. Instead, just check each condition in turn,
terminating as soon as one fails.
In _has_different_parameters_default_value, use a single sentinel value
for a missing default instead of constructing a new one each call. Also
construct the dict of comparators once instead of once each call.
Restructure the logic to be less nested.
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
|
|
|
|
|
| |
Co-authored-by: Alpha <alpha@pokesplash.net>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
a variable. (#5157)
Compare variable default args and simplify the logic of the checkers.
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
|
|
|
|
| |
* Add checkers for typing.final for Python version 3.8 or later
- overridden-final-method
- subclassed-final-class
Closes #3197
|
|
|
| |
Closes #4736
|
|
|
|
|
|
|
|
|
|
|
| |
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.26.0 → v2.28.0](https://github.com/asottile/pyupgrade/compare/v2.26.0...v2.28.0)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fixed 'no-self-check' for async functions.
* fixed 'docparams' for async functions.
* Added 'no-self-use' to the pylint disable comment in broken test.
* Added small changelog entry to Pylint 2.11.0 milestone.
* Added test: 'no-self-use' for async method.
* Added test: revamped 'docparams' functional tests to test all missing documentation.
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
| |
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add type annotations to ``visit`` & ``leave`` calls
This adds typing to most calls that visit nodes. All other changes are
due to mypy errors resulting from introduction of typing.
* Fix outstanding mypy issues
This removes some of the `type: ignore` comments in favour of
solving the mypy issues these comments were surpressing.
* Fix remaining references to node_classes
Except for two references to node_classes in the changelog this should be the last of them
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
removes it later (#4868)
* Simplify the way builtins is used (remove astroid dependencies)
* Replace the constant BUILTINS by the string 'builtins'
This make for clearer and also slightly faster code (means time
seems to decrease by 0.68% with this change alone (astroid/pylint)
in the pylint tests benchmarks). Done because we were using an
import from astroid from astroid.bases for one of those, which is
kinda messy.
|
|
|
|
| |
* Use from astroid import nodes
* Resolve name conflicts
|
|
|
|
| |
This reverts commit ca3bc53fd8d628473fba25c7736d0abfac8e4a4a.
|
|
|
|
|
|
| |
* Fix crash for `unused-private-member` when there are nested attributes
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
also, improve error message for nested functions
|
| |
|
| |
|
| |
|
|
|
|
| |
using ``new``
|
| |
|
|
|
|
| |
* Fix link in license header
* Update link to astroid bump_changelog
|
|
|
|
| |
As seen in issue #4644
|
| |
|
| |
|
|
|
|
| |
See https://github.com/PyCQA/pylint/pull/4642\#discussion_r661805293
|