We've decided to use this plugin in our linting toolchain, which allows us to test things like variable name casing (no camelCase please!) and whether classes and methods use cls and self.
Implementation
Here are the errors it can catch:
code
sample message
N801
class names should use CapWords convention
N802
function name should be lowercase
N803
argument name should be lowercase
N804
first argument of a classmethod should be named 'cls'
N805
first argument of a method should be named 'self'
N806
variable in function should be lowercase
N807
function name should not start and end with '__'
N811
constant imported as non constant
N812
lowercase imported as non lowercase
N813
camelcase imported as lowercase
N814
camelcase imported as constant
N815
mixedCase variable in class scope
N816
mixedCase variable in global scope
We have not decided exactly which of these we should ignore, so it will be up to the person who handles this issue to discuss this with the core devs and come to a consensus on whether we should ignore some of these. It will probably be easier to see which ones here are not necessary after actually running a lint with this plugin on our current codebase.
The person implementing this will also need to fix all the linting errors that occur once this has been added to the toolchain.
Steps
[ ] Add the plugin to the toolchain
[ ] Run it and look through the errors that are created. Are any of them out of touch with our style guidelines, and should we ignore some of these rules? Discuss with the core developers if you think so.
We've decided to use this plugin in our linting toolchain, which allows us to test things like variable name casing (no camelCase please!) and whether classes and methods use
cls
andself
.Implementation
Here are the errors it can catch:
We have not decided exactly which of these we should ignore, so it will be up to the person who handles this issue to discuss this with the core devs and come to a consensus on whether we should ignore some of these. It will probably be easier to see which ones here are not necessary after actually running a lint with this plugin on our current codebase.
The person implementing this will also need to fix all the linting errors that occur once this has been added to the toolchain.
Steps