summaryrefslogtreecommitdiff
path: root/pylint/lint
Commit message (Collapse)AuthorAgeFilesLines
* Load custom plugins when linting in parallel (#8683)Jacob Walls2023-05-142-3/+11
|
* Drop support for Python 3.7 (#8609)Marc Mueller2023-04-242-15/+2
| | | | | * Drop support for Python 3.7 * Update py-version + classifier * Update functional tests
* Disable Info linters in definition instead of Run class (#8576)Matus Valo2023-04-142-9/+25
|
* [PyCQA migration] Upgrade links to the repositories in code and doc (#8514)Pierre Sassoulas2023-03-2910-22/+22
|
* [crash template] Link to blank issue so it's possible to copy pastePierre Sassoulas2023-03-291-4/+28
|
* [crash template] Add <details> tag and current headers for clearer resultPierre Sassoulas2023-03-291-6/+23
| | | | refs #8509
* [deprecation] 'check_single_file' replaced by 'check_single_file_item' (#8478)Pierre Sassoulas2023-03-211-10/+0
|
* [deprecation] Remove 'do_exit' from the 'Run' constructor (#8472)Pierre Sassoulas2023-03-211-15/+1
|
* Add explicit 'stack_level' keyword in Deprecation/User warningsPierre Sassoulas2023-03-212-0/+4
|
* [mypy] Remove some useless assertions in pylint 3.0 (#8467)Pierre Sassoulas2023-03-201-13/+2
|
* [deprecation] 'Pylinter.check' now takes sequence of str only (#8463)Pierre Sassoulas2023-03-201-16/+5
|
* [ruff] Add RUF specific rules and autofix (#8449)Pierre Sassoulas2023-03-143-3/+4
|
* Clear LRU caches on pylint utilities (#8420)Jacob Walls2023-03-101-0/+2
|
* Remove deprecated functions and classes (#8409)Daniël van Noord2023-03-093-58/+1
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* [FileState] Make Pylinter.current_name and msg_store non nullablePierre Sassoulas2023-03-083-36/+7
|
* [__implements__] Remove everything related to the rejected PEP245 (#8404)Pierre Sassoulas2023-03-081-32/+0
|
* Remove all old code related to ``optparse`` config parsing. (#8405)Daniël van Noord2023-03-082-20/+1
| | | | | * Remove all old config parsing code * Temporarily disable a test
* Changing flake8 to have max-line-length of 115 (#8362)Ollie2023-03-021-1/+2
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fixing some too long lines (#8339)Ollie2023-02-251-4/+8
| | | | | * Changing flake8 max-line-length to 120 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Support globbing patterns for source-roots (#8281)Alexey Pelykh2023-02-211-4/+5
| | | Co-authored-by: Andreas Finkler <3929834+DudeNr33@users.noreply.github.com>
* Support Implicit Namespace Packages (PEP 420) (#8153)Alexey Pelykh2023-02-096-29/+113
| | | Co-authored-by: Andreas Finkler <3929834+DudeNr33@users.noreply.github.com>
* Print this error the stderr instead of stdout. (#8142)Yilei "Dolee" Yang2023-01-311-1/+2
|
* Tighten design constraints (#8115)Nick Drozd2023-01-282-0/+2
| | | | | | | | | | | | | * Lower max locals * Lower max statements * Lower max try statements * Lower max branches * Lower max args * Cut design constraints with default values
* [style] Limit line length and complexity using flake8 (#8064)Pierre Sassoulas2023-01-161-1/+2
| | | 125 is a good start. The check was activated in pylint with value = 100, but flake8 is less lenient than pylint and does not make any exceptions (for docstrings, strings and comments in particular).
* [pre-commit] Upgrade to black 23.1a1 with 2023's formatting (#7965)Pierre Sassoulas2022-12-271-1/+1
|
* Fix ModuleNotFoundError when using pylint_django (#7940)Daniel Harding2022-12-141-2/+2
| | | | | | | | Ensure that the import path is fixed up before calling ._astroid_module_checker() so that the pylint_django plugin can successfully import the Django settings module when its checkers are initialized. Closes #7938
* Avoid hanging forever after a parallel job was killed (#7834)Daniel2022-12-122-12/+18
| | | | | | | | | | | | | * Replace multiprocessing.pool with concurrent.futures.ProcessPoolExecutor to avoid deadlocks. In a multiprocessing.pool, if a process terminates in a non-clean fashion (for example, due to OOM or a segmentation fault), the pool will silently replace said process, but the work that the process was supposed to do will never be done, causing pylint to hang indefinitely. The concurrent.futures.ProcessPoolExecutor will raise a BrokenProcessPool exception in that case, avoiding the hang. 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>
* Fix ``no-else-return false Negative for try/except/else pattern (#7888)Dani Alcala2022-12-121-2/+2
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add flag `--clear-cache-post-run` to support server-like usage (#7802)Jacob Walls2022-12-052-1/+14
| | | | | | Use this flag if you expect the linted files to be altered between runs, for instance, if using pylint in a server-like mode. The flag clear's astroid's in-memory caches.
* Enable broad-try-clause check (#7796)Nick Drozd2022-11-181-1/+1
|
* Deduplicate module file paths to prevent redundant scans. (#7747)Eric McDonald2022-11-182-16/+18
| | | | | | | | | | | | | | | * 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>
* Bump mypy from 0.982 to 0.990 (#7769)dependabot[bot]2022-11-141-1/+1
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Avoid deprecation warning in internal use of `may_be_emitted` (#7746)Jacob Walls2022-11-111-12/+13
| | | | | * Refactor MessageDefinitionStore to accept py_version Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Double escape to put escape character in rsttbennett02022-11-091-1/+1
|
* 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>
* [flake8-bugbear] Do not use a call in a function default valuePierre Sassoulas2022-11-051-3/+5
|
* Add default_enabled option to optional message dict (#7629)Marc Mueller2022-10-251-0/+3
|
* Swap plugin cache to pickle-able values when done (#7640)Drummond Ogilvie2022-10-201-2/+10
| | | | | | | | | | | When the dictionary has served its purpose (making plugin loading pre-and-post init a consistent behaviour), we swap it for bools indicating whether or not a module was loaded. We don't currently use the bools, but it seemed a sensible choice. The main idea is to make the dictionary fully pickle-able, so that when dill pickles the linter for multiprocessing, it doesn't crash horribly. Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Use 'py-version' when accounting for max/min version of checker (#7580)Dani Alcala2022-10-131-1/+1
| | | | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Raise ``syntax-error`` correctly on invalid encodings (#7553)Daniël van Noord2022-10-021-1/+4
|
* Use stacklevel=2 in warnings.warn calls to DeprecationWarning where makes ↵Yilei "Dolee" Yang2022-09-151-0/+5
| | | | | | | | sense. (#7465) Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Turn on ``mypy`` strict mode 🎉 (#7448)Daniël van Noord2022-09-092-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 typing across the codebaseDaniël van Noord2022-09-091-3/+1
|
* Add more cases that emit bad-plugin-value (#7284)Drummond Ogilvie2022-09-071-12/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Make ``disable-next`` only consider the succeeding line (#7411)Daniël van Noord2022-09-051-5/+5
|
* Do not lint ignored file on stdin (#7220)Christoph Blessing2022-09-031-6/+11
| | | | | | Previously pylint would lint a file passed on stdin even if the user meant to ignore the file. This commit fixes that issue. Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Refactor check() (#7288)Daniël van Noord2022-08-171-36/+100
|
* Refactors related to separating ast creating and linting (#7286)Daniël van Noord2022-08-141-9/+21
| | | | | | | | | * Set ``_ignore_paths`` in ``initiliaze()`` * Fix typing * Extract FileItems before getting asts Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Revert "Fix the failure to lint modules contained under an identically named ↵Jacob Walls2022-08-131-4/+2
| | | | | | | | | 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`
* Remove imp-specific workaroundJacob Walls2022-08-031-3/+1
|