| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
| |
* split ``non-ascii-name`` into 3 different msgs
- non-ascii-identifier (replaces non-ascii-name)
- non-ascii-file-name (a warning)
- non-ascii-module-import (only considering the namespace the import is imported in)
Co-authored-by: Daniël van Noord <13665637+DanielNoord@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 assigning-non-slot false positive with setattr
Previously, if a class was slotted and overrode `__setattr__`,
`assigning-non-slot` would be issued when assigning to attributes. With
`__setattr__` defined, we cannot infer if it is an error to assign to an
attribute, so we suppress the error.
Fix #3793
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
|
|
|
|
| |
The isinstance checks were not necessary here and caused several false
positives where a function with variadic positional argument was called,
like for example when the call is used as a function argument, in a if,
while or with statement.
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
| |
* Docker: Python 3.10 and Alpine 3.15
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update code example in "How to Write a Checker"
`pylint.testutils.Message` got first renamed to
`pylint.testutils.TestMessage` in 49776acdd and finally renamed to
`pylint.testutils.MessageTest` in 24cbf8c33.
* Add pylbrecht to contributors
Co-authored-by: Philipp Albrecht <philipp.albrecht@momox.biz>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
|
| |
* #5452: Fix false positive missing-doc-param from multi-line Google-style docstrings.
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
|
|
|
|
|
| |
* Clarify syntax in pylint.lint example
This makes the call non-trivial and demonstrates the syntax more fully.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix crashes during toml configuration parsing
Add test for current 'pyproject.toml' issues. Add a 'bad-configuration-section'
message for bad toml configuration
We can detect bad top level option when reading the toml but we do not catch
all the problem in toml because we don't know what is expected so we can't
recommend. See #5259
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using `with threading.Lock():` directly has no effect.
Correct usage is:
```
lock = threading.Lock()
with lock:
...
```
This applies for:
* threading.Lock
* threading.RLock
* threading.Condition
* threading.Semaphore
* threading.BoundedSemaphore
Signed-off-by: Martin Basti <mbasti@redhat.com>
|
|
|
|
|
| |
* add test import for multiprocessing.synchronize
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix access to private function in inner class on protected-access bug
* Add functional test for protected-access from inner class
* Add Ikraduya to CONTRIBUTORS file
* Add if statement to avoid potential bug
* Fix ``protected-access`` for attributes and methods of nested classes
This closes #3066
Co-authored-by: ikraduya <ikraduya@gmail.com>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
| |
* Unify all `<y or n>` metavars
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
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
* 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>
|
|
|
|
|
|
|
| |
a variable. (#5157)
Compare variable default args and simplify the logic of the checkers.
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
| |
|
|
|
|
|
| |
* detect duplicate-key for enum members
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Rename `len-as-condition` to be more general for new checker
`use-implicit-booleaness-not-comparison`
* Refactor `LenChecker` class -> `ImplicitBooleanessChecker`o
* Rename test files/`len_checker.py`/`__init__.py` to reflect new name.
* Add `len-as-condition` as `old_names` for `use-implicit-booleaness-not-len`
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
| |
|
|
|
|
|
| |
Closes #5058
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
| |
* Update toml dependency from >=0.7.1 to >=0.9.2
|
|
|
|
| |
I feel confident enough to fix my own last name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
| |
* Upgrade ignored-parents help description
|
| |
|
|
|
|
|
| |
gathering signature lines (#4858)
* [duplicate-code] Parse functions and class methods recursively when gathering signature lines
|
|
|
|
|
|
|
|
|
|
|
|
| |
signatures flag enabled (#4840)
* [duplicate-code] Ignore decorators lines by similarities checker when ignore signatures flag enabled
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: Maksym Humetskyi <mhumets@softserveinc.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update option_manager_mixin.py
I added user 'JoshMayberry' 's solution for issue 3839.
https://github.com/PyCQA/pylint/issues/3839
I added a test to see if pylint handles environment variables in config file locations.
Added it to test_config because it also deals with config files.
To test I added an environment variable containing tmp_path and then unpacked it with os.path.expandvars.
Tmp_path gets converted to an environment variable which is fed to the read_config_file function to be tested.
Read_config_file succesfully reads the environment variable, if the variable is changed, the function raises an OSError.
|
|
|
| |
* Fix false positives for invalid-all-format (#4711)
|
|
|
| |
pylintd is a directory, so os.remove throws IsADirectoryError
|
|
|
|
|
| |
Closes #3878
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add unspecified-encoding checker #3826
This adds an unspecified-encoding checker that adds a warning
whenever open() is called without an explicit encoding argument.
This closes #3826
* Update tests to conform to unspecified-encoding
With addition of the unspecified-encoding checker calls of open()
need an encoding argument.
Where necessary this argument has been added, or the message has been
disabled.
This also includes small linting changes to a small number
of tests. Their test-data has been updated to reflect new line numbers.
* Update scripts to conform to unspecified-encoding
With addition of the unspecified-encoding checker calls of open()
need an encoding argument.
Where necessary this argument has been added.
* Update pylint to conform to unspecified-encoding
With addition of the unspecified-encoding checker calls of open()
need an encoding argument.
Where necessary this argument has been added.
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
|
|
|
|
|
|
| |
(#4737)
Closes #3791
|
|
|
|
| |
It was deprecated in 3.3 and removed in 3.8.
|
| |
|
| |
|
|
|
|
| |
consider-using-from-import only handles submodules
|
|
|
|
|
| |
* Also catch MroError.
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
|
| |
ignore-signatures option enabled (#4669)
Co-authored-by: Maksym Humetskyi <mhumets@softserveinc.com>
|
|
|
|
|
|
|
|
|
|
|
| |
* VariableChecker now accounts for attribute lookups in type comments
Prior to this commit VariableChecker did not recurse into attribute lookups
in type comments. This lead to false positive unused-import messages in e.g.
import collections
d = ... # type: collections.OrderedDict
Fixes #4603
|
|
|
|
|
| |
checker (#4543)
* remove docs and code associated with the removed W0623 checker
|
|
|
|
|
|
|
|
|
|
| |
* Handle floats when parsing pyproject.toml (#4518)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: Markus Siebenhaar <markus.siebenhaar@masiha.de>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add ``ignore-paths`` configuration directive
List of regex matching against the full path
Close #2541
* Adjusted previous changes for current pylint version.
Co-authored-by: Bernard Nauwelaerts <bernard@cybernet.be>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|