I'm trying out pylint to check my source code for conventions. Somehow some variable names are matched with the regex for constants (const-rgx
) instead of the variable name regex (variable-rgx
). How to match the variable name with variable-rgx
? Or should I extend const-rgx
with my variable-rgx
stuff?
e.g.C0103: 31: Invalid name "settings" (should match (([A-Z_][A-Z1-9_]*)|(__.*__))$)
Pylint analyses your code without actually running it. It checks for errors, enforces a coding standard, looks for code smells, and can make suggestions about how the code could be refactored. Pylint can infer actual values from your code using its internal code representation (astroid).
Pylint is a Python tool that checks a module for coding standards. According to the TurboGears project coding guidelines, PEP8 is the standard and pylint is a good mechanical test to help us in attaining that goal.
Somehow some variable names are matched with the regex for constants (const-rgx) instead of the variable name regex (variable-rgx).
Are those variables declared on module level? Maybe that's why they are treated as constants (at least that's how they should be declared, according to PEP-8).
I just disable that warning because I don't follow those naming conventions.
To do that, add this line to the top of you module:
# pylint: disable-msg=C0103
If you want to disable that globally, then add it to the pylint command:
python lint.py --disable-msg=C0103 ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With