Search code examples
pythonconventionspylint

python code convention using pylint


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_]*)|(__.*__))$)


Solution

  • 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).