I\'m receiving a Pylint error regarding my constant: MIN_SOIL_PARTICLE_DENS
(invalid name).
Any ideas why this constant is wrong? Here\'s my full function:
I found this behavior annoying, but there's a way to configure pylint to avoid this!
Merge the following ini-style declaration into your .pylintrc
file:
[BASIC]
variable-rgx=((([a-z_][a-z0-9_]{2,})|(_[a-z0-9_]*)|(__[a-z][a-z0-9_]+__))$)|([A-Z_][A-Z0-9_]+$)
I built this regex by taking
the default snake_case regex taken from pylint's source at this line,
the default CONST_VAR regex taken from pylint's source at this line
and joining them by |
and some parentheses.
Theoretically, you could also just take .*
, but this would allow even invalid names like mixed_CASE
.