summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Create a new file for BaseChecker unit testsPierre Sassoulas2021-10-272-61/+69
|
* Fix deprecation 'check function will only accept sequence of string' (#5218)Pierre Sassoulas2021-10-272-14/+24
| | | | | * Fix deprecation 'check function will only accept sequence of string' * Add a test for Pylinter.check() deprecation
* Fix the deprecation of set_output in our code (#5209)Pierre Sassoulas2021-10-274-20/+31
| | | | | | | | | | * Fix the deprecation of set_output in our code * Add a test for the deprecation warning itself * Refactor the set_output from the MultiReporter We can remove set_output declaration because the function was already failing with a NotImplementedError before, so removing it make it fail another way
* Clean up some useless-super-delegation logic (#5193)Samuel Freilich2021-10-262-61/+47
| | | | | | | | | | | | | | * 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>
* Merge pull request #5198 from nozzy123nozzy/bugfix_of_propertyAndreas Finkler2021-10-2618-1/+79
|\ | | | | Fix exception of pyreverse in handling property function within a class.
| * Update tests/data/property_pattern.pynozzy123nozzy2021-10-261-5/+0
| | | | | | | | | | | | Remove the "main" function because this is meaningless for testing. Co-authored-by: Andreas Finkler <3929834+DudeNr33@users.noreply.github.com>
| * Modify sources along with results of pr review.Takahide Nojima2021-10-2615-41/+64
| | | | | | | | | | | | | | - move "tests/prop_data/*" to "tests/data/." - make tests/data/property_pattern.py correctly executable. - remove class members not related to "property" from test/data/property_pattern.py. - modify tests of pyreverse to pass all tests.
| * Fix exception of pyreverse in handling property function within a class.Takahide Nojima2021-10-266-0/+60
|/
* Add control flow check for ``undefined-variable`` in ``if ... else``Daniël van Noord2021-10-265-1/+85
| | | | Closes #3688
* Add configuration option ``exclude-too-few-public-methods`` (#5191)Mike Fiedler2021-10-2610-1/+75
| | | | | | | | | 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>
* Move the find_pylintrc function in find_default_config_files.pyPierre Sassoulas2021-10-262-11/+14
|
* Create a OLD_DEFAULT_PYLINT_HOME constantsPierre Sassoulas2021-10-264-7/+12
|
* Create a DEFAULT_PYLINT_HOME constant and upgrade help textPierre Sassoulas2021-10-263-7/+8
|
* Put the environnement help directly where it makes sensePierre Sassoulas2021-10-262-13/+15
|
* Add tests for assignment expressions in function defaults (#5188)Daniël van Noord2021-10-2510-3/+91
| | | | | | | | | * 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>
* 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>