We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider following structure:
|_ mymodule |_ __init__.py |_ example.py |_ myclasses.py
Where __init__.py is empty.
__init__.py
myclasses.py contains:
myclasses.py
class ClassA: badClassVariable = 0
And example.py contains:
example.py
from mymodule.myclasses import ClassA class ClassB: badClassVariable = 0 example_a = ClassA() example_a.badClassVariable = 1 # pylint: disable=invalid-name example_b = ClassB() example_b.badClassVariable = 1 # pylint: disable=invalid-name badVariable = 1 # pylint: disable=invalid-name
Pylint will flag example_a.badClassVariable on line 7 despite disable=invalid-name.
example_a.badClassVariable
disable=invalid-name
Pylint will honor disable=invalid-name on lines 10 and 12 and will not flag example_b.badClassVariable nor badVariable.
example_b.badClassVariable
badVariable
No response
pylint --disable=all --enable=C0103 mymodule
************* Module mymodule.example mymodule/example.py:7:0: C0103: Attribute name "badClassVariable" doesn't conform to snake_case naming style (invalid-name)
Pylint should not report an issue for line 7, as it already does for lines 10 and 12.
pylint 3.2.6 astroid 3.2.4 Python 3.12.3 (main, Apr 9 2024, 08:09:14) [Clang 15.0.0 (clang-1500.3.9.4)] pylintbug-py3.12
Issue occurred on both MacOS 14.6.1 and containereized Alpine linux 3.18.
dill==0.3.8 isort==5.13.2 mccabe==0.7.0 platformdirs==4.2.2 tomlkit==0.13.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug description
Consider following structure:
Where
__init__.py
is empty.myclasses.py
contains:And
example.py
contains:Pylint will flag
example_a.badClassVariable
on line 7 despitedisable=invalid-name
.Pylint will honor
disable=invalid-name
on lines 10 and 12 and will not flagexample_b.badClassVariable
norbadVariable
.Configuration
No response
Command used
Pylint output
Expected behavior
Pylint should not report an issue for line 7, as it already does for lines 10 and 12.
Pylint version
OS / Environment
Issue occurred on both MacOS 14.6.1 and containereized Alpine linux 3.18.
Additional dependencies
The text was updated successfully, but these errors were encountered: