summaryrefslogtreecommitdiff
path: root/pylint/checkers/design_analysis.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix a false negative for ``too-many-arguments`` and positional-only and ↵Mark Byrne2023-05-151-1/+1
| | | | | | | | keyword-only arguments (#8674) Closes #8667
* [PyCQA migration] Upgrade links to the repositories in code and doc (#8514)Pierre Sassoulas2023-03-291-2/+2
|
* Fixes ``method-cache-max-size-none`` false positive (#7908)Dani Alcala2022-12-091-2/+2
| | | | | | | For methods inheriting from ``Enum``. Closes #7857 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Turn on ``mypy`` strict mode 🎉 (#7448)Daniël van Noord2022-09-091-2/+2
| | | | | | | | | | * Ignore subclasses of Any * Add ignores for imported code and remove casts * Add disables for uninferable return values * Turn on ``mypy`` strict mode
* Add typing to ``design_analysis``Daniël van Noord2022-05-241-21/+11
|
* Ignore underscore as a local variable (#6492)Andy Young2022-05-031-0/+5
|
* Run development version of ``pydocstringformatter`` (#6469)Daniël van Noord2022-04-281-4/+4
|
* Add typing to ``BaseChecker`` ``msgs`` and ``reports`` (#6456)Daniël van Noord2022-04-251-1/+4
|
* Migrate from 'check_messages' to 'only_required_for_messages' (#6417)Pierre Sassoulas2022-04-211-6/+6
|
* Remove ``IAstroidChecker`` from ``__implements__``Daniël van Noord2022-04-191-3/+0
|
* Add ``--minimal-messages-config`` option for functional tests (#6246)Andreas Finkler2022-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add ``--minimal-messages-config`` option for functional tests * Add test file option to exclude from --minimal-messages-config run. * Fix ``too-many-branches`` false negative * Fix ``access-member-before-definition`` false negative * Fix ``consider-using-min-builtin`` and ``consider-using-max-builtin`` false negatives * Fix ``consider-using-with`` false negative * Exclude ``deprecated-module`` tests from ``--minimal-messages-config`` run. Have to find out how the list of deprecated modules is built first. * Update doc/whatsnew/2.14.rst * Ignore deprecated module false negatives * Fix ``deprecated-typing-alias`` false negative * Skip tests for ``fixme`` message, don't know yet how enable/disable affects TokenChecker/RawChecker * Exclude functional test for various logging checks, as the output string depends on what messages are enabled. * Fix false negative for ``nan-comparison`` * Fix false negative for ``non-ascii-module-import`` * Fix false negative for ``non-ascii-file-name`` * Skip tests for logging messages * Fix false negative for ``undefined-variable`` in ``metaclass`` argument * Exclude test for ``catching-non-exception``. ``exc._all_bases_known`` is ``False`` when enabling just this message. * Exclude ``ungrouped_imports_suppression``. ``useless-suppression`` is triggered too often in this case. * Fix false negative for ``use-a-generator`` * Exclude functional tests for ``useless-suppression`` from ``--minimal-messages-config`` * Exclude another deprecation check from ``--minimal-messages-config`` run * Update tests/testutils/data/m/minimal_messages_config.py Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Deprecate ``get_global_option``Daniël van Noord2022-04-151-4/+3
|
* Use ``--py39-plus`` and ``--full-reorder`` in ``python-typing-update`` (#6313)Daniël van Noord2022-04-141-1/+2
|
* Replace .namespace with .config (#6316)Daniël van Noord2022-04-141-21/+21
|
* Use ``python-typing-update`` on ``pylint/checkers`` directoryDaniël van Noord2022-04-141-6/+8
|
* Remove the ``future_option_parsing`` keyword (#6253)Daniël van Noord2022-04-111-1/+1
|
* Use ``argparse`` config handler in ``design_analysis.py`` (#6118)Daniël van Noord2022-04-021-22/+25
|
* Remove the concept of checker priority (#6034)Daniël van Noord2022-04-011-1/+0
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add a pre-commit hook to check the copyright noticePierre Sassoulas2022-03-241-1/+1
| | | | | Fix the existing file so they have a notice. No header for setup.py or examples or doc
* Simplify hard to maintain copyright noticePierre Sassoulas2022-03-241-27/+1
| | | | | | git is the source of truth for the copyright, copyrite (the tool) was taking exponentially longer with each release, and it's polluting the code with sometime as much as 50 lines of names.
* Simplify ``cached_property`` import guards (#5915)Daniël van Noord2022-03-141-2/+1
|
* Upgrade ``pydocstringformatter`` to ``0.5.0`` (#5910)Daniël van Noord2022-03-131-1/+3
|
* Use ``functools.cached_property`` on 3.8+ (#5907)Daniël van Noord2022-03-121-1/+8
|
* Update ``pydocstringformatter`` to 0.4.0 (#5787)Daniël van Noord2022-02-101-16/+16
|
* Add typing and uniformize the checker registering in Pylinter (#5558)Pierre Sassoulas2021-12-271-3/+5
| | | | | Remove verbose docstring in code, keep them in example and doc Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Fix typos accross the whole codebase (#5575)Pierre Sassoulas2021-12-211-3/+2
| | | | Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Bump pylint to 2.12.2, update changelogv2.12.2Pierre Sassoulas2021-12-031-1/+1
|
* Bump pylint to 2.12.0, update changelogv2.12.0Pierre Sassoulas2021-11-251-0/+4
| | | | Closes #5250
* Add configuration option ``exclude-too-few-public-methods`` (#5191)Mike Fiedler2021-10-261-0/+22
| | | | | | | | | 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>
* Async context manager typo (#5164)Youngsoo Sung2021-10-171-1/+1
|
* Refactor ``LinterStats`` (#5074)Daniël van Noord2021-10-071-3/+1
| | | | | | | | * Refactor ``self.stats`` on linter and checker This adds a new class ``LinterStats`` which is used to store all kinds of stats during a run of ``pylint``. Tests have been changed slightly to be able to use the new class. Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* [pre-commit.ci] pre-commit autoupdate (#5082)pre-commit-ci[bot]2021-09-281-1/+1
| | | | | | | | | | | * [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>
* Fix loop in too-many-ancestors when an inheritance cycle is inferred (#5062)Andrew Haigh2021-09-241-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add regression test for #4972 hang * Fix loop in too-many-ancestors when an inheritance cycle is inferred Ref #4972. If a class could be inferred as an ancestor of itself then the implementation of _get_parents could get caught in an infinite loop, forever adding itself to to_explore. This could be possible by monkeypatching an ancestor after class definition like in the following simplified example: class Fake(module.Cls): pass module.Cls = Fake Reproducing this is fairly tricky, but this integration test shows the behaviour as of 1e675abcc2aa931421d7ce300908e734a93fd790: #!/bin/sh HERE=$(readlink -f .) VENV=$HERE/venv-repro PIP=$VENV/bin/pip python -m venv "$VENV" PYLINT=$VENV/bin/pylint # assume running in pylint dir $PIP install -e . $PIP install flask mkdir -p repro/flask/ touch repro/__init__.py cat > repro/flask/__init__.py <<'EOF' import flask import repro.flask # self-import necessary class Fake(flask.Flask): pass flask.Flask = Fake EOF echo +++ this is fine $PYLINT --rcfile=/dev/null -- repro/flask/ echo +++ finished echo +++ this loops forever cd repro/; $PYLINT --rcfile=/dev/null -- flask/ echo +++ should not reach here
* Bump pylint to 2.11.0, update changelogv2.11.0Pierre Sassoulas2021-09-161-0/+2
|
* Add typing to all calls to ``self.stats`` (#4973)Daniël van Noord2021-09-151-1/+2
| | | | | | | | | | | | | | | * 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>
* Refactor various typing related issues (#4940)Daniël van Noord2021-09-031-11/+11
| | | | | | | | | | | | | | | * 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>
* Upgrade ignored-parents help description (#4926)Melvin2021-08-281-1/+1
| | | * Upgrade ignored-parents help description
* Bump pylint to 2.10.0, update changelogv2.10.0Pierre Sassoulas2021-08-201-0/+1
|
* Add ignored-parents option to design checker (#4758)Rebecca Turner2021-07-281-4/+42
| | | | | | | | | | | * Add ignored-parents option to design checker This allows users to specify classes to ignore while counting parent classes. Partially closes #3057 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix copyright links (#4647)Marc Mueller2021-07-011-1/+1
| | | | * Fix link in license header * Update link to astroid bump_changelog
* Bump pylint to 2.9.0-dev1, update changelogPierre Sassoulas2021-06-171-0/+1
|
* Update name for consider-using-namedtuple to include dataclass (#4536)Marc Mueller2021-06-021-1/+1
| | | | | * Change msg name to include dataclass * Update pylint ignores * Update tests
* Add new checker consider-using-namedtuple (#4517)Marc Mueller2021-05-311-1/+1
| | | | * Add new checker consider-using-namedtuple * Add disable for existing code base
* Fixed false negative of consider-using-enumerate on attributes (#4508)yushao22021-05-261-1/+1
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix too-many-ancestorsMarc Mueller2021-04-281-2/+88
|
* Changes after black updateMarc Mueller2021-04-261-1/+1
|
* Rename copying to license and upgrade the setup.cfg (#4338)Pierre Sassoulas2021-04-111-1/+1
|
* Remove implicit concat in str shortened enough by blackPierre Sassoulas2021-04-041-1/+1
|
* Prepare 2.7.3 release (#4261)pylint-2.7.32.7Pierre Sassoulas2021-03-291-0/+1
|
* Import astroid with import x or from x import y but not bothPierre Sassoulas2021-03-281-5/+6
| | | | Remove unused imports for astroid