summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Move the find_pylintrc function in find_default_config_files.pymove-env-help-to-the-logical-placePierre Sassoulas2021-10-252-11/+14
|
* Create a OLD_DEFAULT_PYLINT_HOME constantsPierre Sassoulas2021-10-254-7/+12
|
* Create a DEFAULT_PYLINT_HOME constant and upgrade help textPierre Sassoulas2021-10-253-7/+8
|
* Put the environnement help directly where it makes sensePierre Sassoulas2021-10-252-13/+15
|
* Use backticks for any-all suggestion (#5207)Nick Drozd2021-10-253-8/+16
| | | | | | * Use backticks for any-all suggestion If the suggestion contains a string, then the suggestion's quotes can get mixed up with the the string's quotes.
* Enable for_any_all check (#5206)Nick Drozd2021-10-2512-96/+54
| | | | | | | * Enable for_any_all check, reword a few docstrings, shorten some loop variable names, and add typing on modified functions. Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Add ``mixin-class-rgx`` option (#5203)Daniël van Noord2021-10-2512-15/+118
| | | | | 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-259-0/+404
| | | | | | | | | * 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-248-43/+166
| | | | | Closes #5194 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix regression for ``_is_only_type_assignment`` (#5163)Daniël van Noord2021-10-236-43/+142
| | | | | | | | | | | | | | | | * Fix regression for ``_is_only_type_assignment`` This closes #5162 * Remove references to `name` * Better tests for assignment * Move walrus tests to different file * Fix tests with incorrect typing * Update typing of `defstmt` Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Make ``used-before-assignment`` consider classes in method annotation and ↵Daniël van Noord2021-10-2310-10/+126
| | | | | | | | | 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 use-implicit-booleaness-not-comparison crash (#5176)Jaehoon Hwang2021-10-235-58/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix use-implicit-booleaness-not-comparison crash `use-implicit-booleaness-not-comparison` caused a crash due to `target_node` not being an instance of `NodeNG.Name` This fix will allow the checker to have a default handling when it encounters `target_node` other than `Calls`,`Name`, or `Attribute` * Added more comprehensive test for implicit_booealness_checker * Make implicit_booealness_checker to have default `variable_name` * Handle `Calls`,`Name`, or `Attribute` * Fix typing in ImplicitBooleanessChecker.base_classes_of_node * [implicit-booleaness] Add call nodes name in warnings * Use `BaseContainer` to check for empty tuple/list and use `as_string` for `Attribute` and `Name` nodes for message Using `BaseContainer` for checking for empty `tuple` and `list`. In addition, `is_base_container` checks for `FrozenSet` and `Set` as well. * Update test cases with cr concerns * Use `BaseContainer` when checking for empty list or tuple * Update `is_literal_tuple/list` to use `is_base_container` * Use `as_string` when giving out function or variable name for message. * Fix broken baseContainer test * Use safe_infer for inferencing `target_instance` * Swap opreators message * Address CR comments; no more try/catch for infer & Add more test cases * Add more test cases and changed few cases to cover more cases. * Remove `try/catch` from `safe_infer` since `safe_infer` will return `None` when it encounters exceptions. * Comparison from infer to be more explicit; using `None` instead of relying on `bool` Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix test decorator for `PyLinter` options (#5195)Daniël van Noord2021-10-222-5/+18
|
* PR #5157 followup (#5192)Nick Pesce2021-10-211-10/+10
|
* Fix useless-super-delegation false positive when default keyword argument is ↵Nick Pesce2021-10-196-76/+70
| | | | | | | 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-195-9/+29
| | | | Closes #4426
* Fix asterisks parsing of ``mising-param-doc`` (#5175)Daniël van Noord2021-10-187-19/+65
| | | Closes #3733
* Make ``undefined-variable`` check line numbers of metaclass parametersDaniël van Noord2021-10-185-6/+34
|
* Add test for #4021Daniël van Noord2021-10-182-8/+21
| | | | This closes #4021
* Bump types-toml from 0.10.0 to 0.10.1 (#5182)dependabot[bot]2021-10-181-1/+1
| | | | | | | | | | | | | | | | Bumps [types-toml](https://github.com/python/typeshed) from 0.10.0 to 0.10.1. - [Release notes](https://github.com/python/typeshed/releases) - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update tbump requirement from ~=6.4.1 to ~=6.5.0 (#5181)dependabot[bot]2021-10-181-1/+1
| | | | | | | | | | | | | | | | Updates the requirements on [tbump](https://github.com/dmerejkowsky/tbump) to permit the latest version. - [Release notes](https://github.com/dmerejkowsky/tbump/releases) - [Changelog](https://github.com/dmerejkowsky/tbump/blob/main/Changelog.rst) - [Commits](https://github.com/dmerejkowsky/tbump/compare/v6.4.1...v6.5.0) --- updated-dependencies: - dependency-name: tbump dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump actions/checkout from 2.3.4 to 2.3.5 (#5180)dependabot[bot]2021-10-183-13/+13
| | | | | | | | | | | | | | | | | Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.4 to 2.3.5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2.3.4...v2.3.5) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Refactor Variable checker to use less argument in function (#5167)Pierre Sassoulas2021-10-171-47/+50
| | | We only need the node because we can get the name from the node.
* Add an exception at install for python < 3.6.2 (#5171)Pierre Sassoulas2021-10-171-0/+17
| | | | | | | * Add an exception for python < 3.6.2 See https://github.com/PyCQA/pylint/issues/5065 for reasoning Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Async context manager typo (#5164)Youngsoo Sung2021-10-172-1/+3
|
* Fix ``missing-function-docstring`` not checking ``__init__`` (#5147)Daniël van Noord2021-10-174-1/+52
| | | | | | * Fix ``missing-function-docstring`` not checking ``__init__`` * Ignore ``object``
* Merge ``MessagesHandlerMixIn`` into ``PyLinter`` (#5136)Daniël van Noord2021-10-176-156/+179
| | | * Merge ``MessagesHandlerMixIn`` into ``PyLinter``
* Upgrade astroid version to 2.8.3Pierre Sassoulas2021-10-172-2/+2
|
* Fix ``relative-beyond-top-level`` false positiveDaniël van Noord2021-10-1717-0/+64
|
* pyreverse - Add project modules to sys.path (#4856)Mark Byrne2021-10-175-27/+57
| | | | | | | | | | | | | | | * pyreverse - Add project modules to sys.path - Use the fix_import_path context manager in the existing pyreverse tests - Style refactor: - Use a constant for the path - Move the constants closer to the top of the module - Add a test for the fix_import_path context manager to ensure the project root directory is in sys.path - Prevent re-defining from outer scope - Add a type-hint & docstrings Closes #2479
* From Python 3.8 onwards classes inheriting from dict are reversible (#5169)Tim Martin2021-10-177-12/+37
| | | | | | | | | | | * From Python 3.8 onwards classes inheriting from dict are reversible This generalises an earlier change to the bad-reversed-sequence checker in Python 3.8 onwards: dicts were already being treated as reversible, but so should any class inheriting from dict. Fixes #4981 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add a warning ``use-implicit-booleaness-not-comparison`` for comparison with ↵Jaehoon Hwang2021-10-1719-64/+384
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Consider Enums when checking for duplicate dictionary keys (#5155)jaydesl2021-10-165-6/+31
| | | | | * detect duplicate-key for enum members Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix py-version usage in typing extension tests (#5161)Marc Mueller2021-10-156-8/+8
|
* Use py-version for alternative union syntax check (#5160)Marc Mueller2021-10-156-5/+17
|
* Make ``undefined-variable`` flag type annotation without value assignment ↵Daniël van Noord2021-10-155-32/+96
| | | | | | | (#5158) Closes #5140 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Improve documentation of ``docparams`` extension and fix tests (#5095)Daniël van Noord2021-10-142-1/+86
| | | This closes #4136
* Use ``MessageLocationTuple`` in ``_add_one_message``Daniël van Noord2021-10-131-2/+4
|
* Create new ``UnsupportedVersionChecker`` checker class (#5148)Daniël van Noord2021-10-134-17/+59
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* [pre-commit.ci] pre-commit autoupdate (#5145)pre-commit-ci[bot]2021-10-121-2/+2
| | | | | | | updates: - [github.com/PyCQA/flake8: 3.9.2 → 4.0.1](https://github.com/PyCQA/flake8/compare/3.9.2...4.0.1) - [github.com/pre-commit/mirrors-mypy: v0.910 → v0.910-1](https://github.com/pre-commit/mirrors-mypy/compare/v0.910...v0.910-1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Bump flake8 from 3.9.2 to 4.0.1 (#5142)dependabot[bot]2021-10-111-1/+1
| | | | | | | | | | | | | | | | Bumps [flake8](https://github.com/pycqa/flake8) from 3.9.2 to 4.0.1. - [Release notes](https://github.com/pycqa/flake8/releases) - [Commits](https://github.com/pycqa/flake8/compare/3.9.2...4.0.1) --- updated-dependencies: - dependency-name: flake8 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update tbump requirement from ~=6.4.0 to ~=6.4.1 (#5143)dependabot[bot]2021-10-111-1/+1
| | | | | | | | | | | | | | | | Updates the requirements on [tbump](https://github.com/dmerejkowsky/tbump) to permit the latest version. - [Release notes](https://github.com/dmerejkowsky/tbump/releases) - [Changelog](https://github.com/dmerejkowsky/tbump/blob/main/Changelog.rst) - [Commits](https://github.com/dmerejkowsky/tbump/compare/v6.4.0...v6.4.1) --- updated-dependencies: - dependency-name: tbump dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump python-docs-theme from 2021.8 to 2021.11.1 (#5141)dependabot[bot]2021-10-111-1/+1
| | | | | | | | | | | | | | | | | Bumps [python-docs-theme](https://github.com/python/python-docs-theme) from 2021.8 to 2021.11.1. - [Release notes](https://github.com/python/python-docs-theme/releases) - [Changelog](https://github.com/python/python-docs-theme/blob/master/CHANGELOG.rst) - [Commits](https://github.com/python/python-docs-theme/compare/2021.8...2021.11.1) --- updated-dependencies: - dependency-name: python-docs-theme dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add ``using-f-string-in-unsupported-version`` checker (#5139)Daniël van Noord2021-10-116-0/+31
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Remove calls to ``os.linesep`` and add misc. typingDaniël van Noord2021-10-102-4/+4
|
* Properly identify undocumented parameters and add new message called ↵Konstantina Saketou2021-10-1012-33/+199
| | | | | | | | | | | | | | | | | | | 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>
* Move message adding functions from ``MessagesHandlerMixIn``Daniël van Noord2021-10-103-208/+226
|
* Add checkers for typing.final for Python version 3.8 or later (#5133)Mark Byrne2021-10-109-0/+86
| | | | | | | | * 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-109-67/+89
| | | | | | | | | | 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>
* Add support for `ModuleNotFoundError` Python 3.6+ builtin-exception (#5106)Samuel FORESTIER2021-10-097-14/+49
|