summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Bump pylint to 2.11.0, update changelogv2.11.0Pierre Sassoulas2021-09-1688-24/+139
|
* Add typing to ``filepath`` (#4980)Daniël van Noord2021-09-1620-115/+164
| | | | | | | | | | * Change tests for ``filepath`` changes * Add pylint/typing.py and FileItem NamedTuple * Use NamedTuple more efficiently * Fix errors and tests after adding warning * Add deprecation for future API change in Checker Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add typing in ``pylint.reporters`` (#5004)Pierre Sassoulas2021-09-1611-73/+118
| | | | | | | | | | | | * Add typing and fix small issue in pylint.reporters Fix typing error in pylint/checkers/imports.py. Add typing of report related code outside of pylint.reporters. * Remove unused argument in pylint.reporters.VNode constructor * Simplify and specify the typing in reporters nodes Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Move methods to `BaseLayout` (#5015)Daniël van Noord2021-09-162-15/+13
| | | | | * Move methods to `BaseLayout` and change typing, see https://github.com/PyCQA/pylint/pull/5004#discussion_r708532947
* Move PyreverseConfig to pylint.testutil (#5013)Pierre Sassoulas2021-09-154-47/+52
| | | See : https://github.com/PyCQA/pylint/pull/5010#issuecomment-920291278
* Add typing to all calls to ``self.stats`` (#4973)Daniël van Noord2021-09-1519-63/+154
| | | | | | | | | | | | | | | * Add typing to all calls to ``self.stats`` All checkers inherit from a baseclass which has a ``stats`` attribute. This attribute has a fairly unmanageable type, but the current typing includes all variations of the attribute. Other changes not directly related to ``self.stats`` are due to ``mypy``warnings. This incorporate the feedback received in #4954 * Add ``CheckerStatistic`` class to ``pylint/typing`` * Guard `typing.Counter` import Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Remove most `typing.cast()` calls (#4995)Daniël van Noord2021-09-153-17/+3
|
* Fix PyreverseConfig imports in pyreverse's testsPierre Sassoulas2021-09-153-2/+5
|
* Change lines to lists (#5009)Daniël van Noord2021-09-143-7/+7
|
* Update CONTRIBUTORS.txtDimitri Prybysh2021-09-141-1/+1
| | | | I feel confident enough to fix my own last name.
* Add functional test demonstrating #4370Dimitri Prybysh2021-09-142-0/+18
| | | | After PyCQA/astroid#1166 is merged, this test should become green.
* Fix deprecation warning for AssignAttr in tests (#5006)Pierre Sassoulas2021-09-141-9/+6
| | | | | | | * Fix deprecation warning for AssignAttr We should initialize nodes using their constructor Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Fix false positive ``unused-private-member`` for accessing attributes in a ↵yushao22021-09-145-8/+39
| | | | | | | | 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-145-27/+75
|
* Pylint reporter cleanup (#5003)Pierre Sassoulas2021-09-144-110/+104
| | | | | | | | | | * Create a file for pylint.reporters.BaseWritter * Calculate visitor name only once in Reporter nodes Remove dead code that was always failing and replace it by an attribute directly. Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Add tests for dataclasses (#4967)Daniël van Noord2021-09-142-2/+9
| | | | * Add tests for dataclasses This closes #4963 and is based on the fix in PyCQA/astroid#1165
* Upgrade astroid to 2.8.0Pierre Sassoulas2021-09-142-2/+3
|
* Fix false negative for use-symbolic-messagePierre Sassoulas2021-09-144-15/+20
| | | | Closes #5000
* [pre-commit.ci] pre-commit autoupdate (#4998)pre-commit-ci[bot]2021-09-141-2/+2
| | | | | | | updates: - [github.com/asottile/pyupgrade: v2.25.0 → v2.26.0](https://github.com/asottile/pyupgrade/compare/v2.25.0...v2.26.0) - [github.com/pre-commit/mirrors-prettier: v2.3.2 → v2.4.0](https://github.com/pre-commit/mirrors-prettier/compare/v2.3.2...v2.4.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix bad node given to a message and false positive invalide format for ↵Pierre Sassoulas2021-09-135-6/+23
| | | | | | | | | | | | | ``__all__`` (#4953) * Fix bad node being given as context for message See https://github.com/PyCQA/pylint/issues/4711\#issuecomment-910020972 * Add a functional test for issue #4711 * Fix false positive invalid-all-format Closes #4711
* Bump sphinx from 4.1.2 to 4.2.0dependabot[bot]2021-09-131-1/+1
| | | | | | | | | | | | | | | Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 4.1.2 to 4.2.0. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/4.x/CHANGES) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v4.1.2...v4.2.0) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
* Add typing to most reference of ``stream``Daniël van Noord2021-09-139-55/+85
|
* Type ``process_module`` and update argument namesDaniël van Noord2021-09-139-18/+27
|
* Documentation for ``pyreverse`` and ``symilar`` (#4992)Andreas Finkler2021-09-116-0/+114
| | | | | | | | | | | * Add documentation for ``pyreverse`` and ``symilar`` * Rephrase "additional tools" to "additional commands" to be consistent with Readme * Replace some example diagrams with PlantUML ones and fix errors preventing the doc to build * Incorporate review feedback * Only hint to the ``-h`` option instead of including all options manually in the docs
* Make ``global-variable-not-assigned`` check local scope (#4990)Daniël van Noord2021-09-118-12/+78
| | | | | | | | | | | | * 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 no-self-use and docparams extension for async functions/methods (#4986)SupImDos2021-09-119-8/+66
| | | | | | | | | | | | | | | | * 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>
* Fix bug with cache's parent directory not existing (#4988)Daniël van Noord2021-09-103-1/+9
| | | | | | 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
* Use overload to type get_global_option (#4978)Daniël van Noord2021-09-083-4/+91
| | | | | | * Use ``overload`` to type ``get_global_option`` * Use type alias and TypeVar Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* fix false positive W0238 with private staticmethod used from classmethod (#4949)Kayran Schmidt2021-09-074-3/+29
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Make ``min-similarity-lines == 0`` stop similarity check (#4970)Daniël van Noord2021-09-074-0/+18
| | | | | | | | * 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>
* Merge pull request #4979 from jacobtylerwalls/useless-suppression-typoAndreas Finkler2021-09-071-2/+2
|\ | | | | Fix typos in useless-suppression topic
| * Fix typos in useless-suppression topicJacob Walls2021-09-061-2/+2
|/
* Add additional test case - consider-using-assignment-expr (#4975)Marc Mueller2021-09-061-1/+12
|
* Update pre-commit requirement from ~=2.14 to ~=2.15 (#4974)dependabot[bot]2021-09-061-1/+1
| | | | | | | | | | | | | | | | Updates the requirements on [pre-commit](https://github.com/pre-commit/pre-commit) to permit the latest version. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v2.14.0...v2.15.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Merge pull request #4971 from cdce8p/feat_consider-using-inAndreas Finkler2021-09-065-2/+14
|\ | | | | Extend consider-using-in for attribute access
| * Extend consider-using-in for attribute accessMarc Mueller2021-09-055-2/+14
|/
* Remove test dependency mypy-extensions (#4969)Marc Mueller2021-09-052-2/+6
|
* Add typing with `PyAnnotate` to `./tests` (#4950)Daniël van Noord2021-09-0469-775/+965
| | | | | | * Add mypy_extensions to requirement for ``NoReturn`` Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Moved ``consider-using-f-string`` to `RecommendationChecker` (#4957)Daniël van Noord2021-09-033-101/+108
| | | | | Based on discussion in #4787 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Refactor various typing related issues (#4940)Daniël van Noord2021-09-0347-349/+375
| | | | | | | | | | | | | | | * 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>
* Add test to ``superfluous-parens``Daniël van Noord2021-09-021-2/+5
| | | | Additional test based on a suggestion in #4907
* Remove unused ``visit_package`` functionDaniël van Noord2021-09-011-10/+0
|
* Fix false positive ``superfluous-parens`` for tuplesDaniël van Noord2021-09-016-27/+43
| | | | | | Tuples can be created with inner tuples. This creates double parenthesis which we flagged incorrectly. This closes #4907
* Fix the raising-bad-type warning for stringPierre Sassoulas2021-09-014-5/+11
| | | | | | Apparently this use case was supposed to be handled by the py3K checker but as it was disabled all the time the issue has'nt been handled at all for a long time.
* Extend ``unspecified-encoding`` checkerDaniël van Noord2021-09-015-18/+53
| | | | | | 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-0164-2868/+67
| | | | | | 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.
* Remove dead visit_exec method (#4943)Marc Mueller2021-09-011-5/+0
| | | * In Python 3 'exec' is just a 'Call' node
* Fix false positive `dict-iter-missing-items` for tuple keys (#4939)Daniël van Noord2021-08-315-1/+16
| | | | | | 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-317-7/+50
| | | | | | | | * 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-315-8/+28
| | | | Closes #4936