summaryrefslogtreecommitdiff
path: root/tests/lint
Commit message (Collapse)AuthorAgeFilesLines
* [PyCQA migration] Upgrade links to the repositories in code and doc (#8514)Pierre Sassoulas2023-03-297-16/+16
|
* [crash template] Link to blank issue so it's possible to copy pastePierre Sassoulas2023-03-291-4/+8
|
* [deprecation] 'Pylinter.check' now takes sequence of str only (#8463)Pierre Sassoulas2023-03-201-7/+0
|
* [deprecation] Remove the warning about the old pylint home (#8462)Pierre Sassoulas2023-03-201-51/+4
| | | Also remove related tests, and simplify existing one
* [ruff] Add RUF specific rules and autofix (#8449)Pierre Sassoulas2023-03-141-2/+2
|
* Remove deprecated functions and classes (#8409)Daniël van Noord2023-03-091-9/+0
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Remove all old code related to ``optparse`` config parsing. (#8405)Daniël van Noord2023-03-082-75/+3
| | | | | * Remove all old config parsing code * Temporarily disable a test
* Support globbing pattern for input specification (#8312)Alexey Pelykh2023-03-011-2/+13
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add ``invalid-name`` check for ``TypeAlias`` names (#7116)Daniël van Noord2023-02-261-0/+1
|
* Support globbing patterns for source-roots (#8281)Alexey Pelykh2023-02-211-0/+14
| | | Co-authored-by: Andreas Finkler <3929834+DudeNr33@users.noreply.github.com>
* Support Implicit Namespace Packages (PEP 420) (#8153)Alexey Pelykh2023-02-092-8/+67
| | | Co-authored-by: Andreas Finkler <3929834+DudeNr33@users.noreply.github.com>
* [ruff] Autofix 'not x in iterator' => 'x not in iterator'Pierre Sassoulas2023-02-061-3/+3
|
* Tighten design constraints (#8115)Nick Drozd2023-01-281-0/+1
| | | | | | | | | | | | | * Lower max locals * Lower max statements * Lower max try statements * Lower max branches * Lower max args * Cut design constraints with default values
* [pre-commit] Upgrade to black 23.1a1 with 2023's formatting (#7965)Pierre Sassoulas2022-12-271-2/+0
|
* Fix inconsistent argument exit code when argparse exit with its own error ↵David Lawson2022-12-142-0/+45
| | | | | | | | | | | | | | | | | | | | | | code (#7931) Returning 2 here is confusing as it doesn't match the documentation: https://pylint.pycqa.org/en/latest/user_guide/usage/run.html#exit-codes * pylint: use exit code 32 when invalid arguments are passed * pylint: add failing test when ambiguous abbreviated parameters are set in a config file This is confusing behaviour. The output is: ``` usage: pylint [options] pylint: error: ambiguous option: --no could match --notes, --notes-rgx, --no-docstring-rgx ``` The exit code is 2 which doesn't match the documentation: https://pylint.pycqa.org/en/latest/user_guide/usage/run.html#exit-codes * pylint: use exit code 32 when ambiguous abbreviated parameters are set in a config file Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Drop dependency on py module (#7829)Lumír 'Frenzy' Balhar2022-11-231-7/+8
| | | | | | | | | * pytest 7.2 no longer depends on py so it's better to drop it. `tmp_path` fixture is newer and uses `pathlib.Path` from stdlib instead of `LocalPath` from `py._path`. Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Andreas Finkler <3929834+DudeNr33@users.noreply.github.com>
* Deduplicate module file paths to prevent redundant scans. (#7747)Eric McDonald2022-11-181-18/+63
| | | | | | | | | | | | | | | * Use dict for 'expand_modules' result rather than list. With 'path' as the key, we get deduplication for free and do not need to reprocess the list for deduplication later. * Fix deduplication to account for CLI args marker. * Fix corner case with CLI arg flag handling during deduplication. * Add 'deduplication' to custom Pyenchant dict. Closes #6242 Closes #4053 Co-authored-by: Eric McDonald <emcd@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Rename `broad-except` and new check `broad-exception-raised` (#7709)Dani Alcala2022-11-051-1/+1
| | | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add and fix tests for init-hook based plugin load (#7475)Drummond Ogilvie2022-09-161-41/+133
| | | | | | | | | | | | | | | | | | | * Add and fix tests for init-hook based plugin load This changes 4 existing tests, due to a misunderstanding of the author (past me) in a couple of the details of those tests. Specifically, we now copy a single python file to use as our plugin, and make sure to correctly check for the name as given in the checker classes. We also make sure not to accidentally load the old copy of the plugin, which apparently sits in a directory that is already on the system path. There is also a single new test, which covers the cases of loading a plugin with ``init-hook`` magic, both specified in an rc file, but in different orders. This should be sufficient to close the issue around #7264. Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.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
* Finish unfinished typing in non core directories (#7443)Daniël van Noord2022-09-091-3/+7
| | | | | | | | * Add typing to setup calls in documentation folder * Finish some incomplete typing signatures in script * Add typing to unfinished signatures in the tests directory
* Finish some incomplete typing signatures (#7442)Daniël van Noord2022-09-091-2/+3
|
* Turn on ``check-untyped-defs`` in ``mypy`` (#7407)Daniël van Noord2022-09-091-2/+4
|
* Add more cases that emit bad-plugin-value (#7284)Drummond Ogilvie2022-09-071-3/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add x-failing test for issue 7264 case 3 This is the case where a plugin can be imported only after the init-hook is run, and the init hook is specified in a pylintrc file We would expect the module to not load in any case, and cause the emission of a bad-plugin-value message. * _dynamic_plugins is a dict not a set This is in preparation for caching the loaded modules, and for storing other information that will help in identifying times loading is dependent on init-hook magic. * Use cached module objects for load_configuration This fixes case 3 in #7264, and is technically a breaking change, in that it now emits a message for what would have previously been a silent failure. * Interim review comment fixes 1. Remove the xfail that snuck back in after the rebases. 2. Now that fake_home yields a str, update the type hint. * Add test for bad plugin with duplicated load This is case 6 in issue #7264, and represents the other silent failure that is being made non-silent by this change. * Apply review feedback - Add an ordering test for CLI arguments - Add clarifying comments on affected functions - Tidy up test assertions to be more pythonic Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Remove ignores for ``LocalPath``Daniël van Noord2022-09-031-1/+1
|
* Add typing to ``unittest_lint``Daniël van Noord2022-09-031-13/+14
|
* Add regression test for #3651 (#7117)Jacob Walls2022-08-211-0/+32
|
* Refactor check() (#7288)Daniël van Noord2022-08-171-5/+20
|
* Revert "Fix the failure to lint modules contained under an identically named ↵Jacob Walls2022-08-131-7/+10
| | | | | | | | | directory" (#7304) This reverts commit 3ebb700aed88a427011c2e88705f66ec0b3830a4. * Add regression test for namespace packages under directory on path * Fix expected result in `test_relative_beyond_top_level_two`
* Fix the failure to lint modules contained under an identically named directoryJacob Walls2022-08-031-0/+9
|
* Add regression test for #1667 (#7113)Jacob Walls2022-07-181-0/+9
|
* [typing] Add typing to the tests directory (#7183)Pierre Sassoulas2022-07-141-1/+1
|
* Restore `sys.path` in `test_load_plugin_configuration` (#7119)Jacob Walls2022-07-041-0/+2
|
* Respect ignore configuration options when --recursive=y. (#6528)Matus Valo2022-05-131-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Ignore specified files/directories in recursive mode * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update Changelog * Fix typo in Changelog * Fix typo in comment * Add missing regrtest data directory * Improved unittests * Move common code of checking if file is ignored to separate function * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rename is_ignored_file to _is_ignored_file Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update ChangeLog Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> 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> Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Fix disabling of ``bad-option-value`` (#6556)Daniël van Noord2022-05-091-4/+9
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add regression test for #6538 (#6553)Jacob Walls2022-05-091-0/+22
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Pass ``msg_store`` and ``node`` to ``FileState`` (#6558)Daniël van Noord2022-05-091-1/+1
|
* Revert "Do not append namespace packages to sys.path (#6405)" (#6548)Pierre Sassoulas2022-05-092-33/+0
| | | This reverts commit 603be8408a5d2d98283f41cfd9a94998fd7cfd3c.
* Fix saving of persistent data files on different drives (#6526)Daniël van Noord2022-05-061-6/+59
|
* Move caching to pylint.lint from pylint.config and deprecate (#6468)Pierre Sassoulas2022-05-052-0/+77
| | | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Move ``PYLINTHOME`` to constants and test it (#6509)Daniël van Noord2022-05-051-2/+40
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Do not append namespace packages to sys.path (#6405)Daniël van Noord2022-05-022-0/+34
| | | Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Remove some words from custom dictionary and update spellingDaniël van Noord2022-04-261-1/+1
|
* Use an empty pylintrc for tests using project's pylintrc implicitelyPierre Sassoulas2022-04-262-2/+3
| | | | | | | | | | We don't want to use the project's pylintrc during tests, because it means that a change in our config could break tests. But we want to see if the changes to the default break tests. Create a private '_Run' class in pylint.testutil._run Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Add typing to ``BaseChecker`` ``msgs`` and ``reports`` (#6456)Daniël van Noord2022-04-251-1/+2
|
* Finish typing of ``pylint/lint/pylinter.py`` (#6428)Daniël van Noord2022-04-211-0/+9
| | | | | * Catch AssertionError in ``_load_reporter_by_name`` as well Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Migrate from 'check_messages' to 'only_required_for_messages' (#6417)Pierre Sassoulas2022-04-211-2/+2
|
* Remove ``IAstroidChecker`` from ``__implements__``Daniël van Noord2022-04-191-1/+0
|
* Improve CPU count detection in cgroup environments and fix CI (#6098)Daniël van Noord2022-04-161-0/+2
| | | | Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Deprecate ``get_global_option``Daniël van Noord2022-04-151-3/+2
|