Module implementing a checker for naming conventions.
None |
NamingStyleChecker | Class implementing a checker for naming conventions. |
None |
Class implementing a checker for naming conventions.
CamelcaseRegexp |
Codes |
LowercaseRegex |
MixedcaseRegexp |
UppercaseRegexp |
None |
NamingStyleChecker | Constructor (according to 'extended' pycodestyle.py API) |
__checkClassName | Private class to check the given node for class name conventions (N801). |
__checkFunctionArgumentNames | Private class to check the argument names of functions (N803, N804, N805, N806). |
__checkFunctionName | Private class to check the given node for function name conventions (N802). |
__checkImportAs | Private method to check that imports don't change the naming convention (N811, N812, N813, N814). |
__checkModule | Private method to check module naming conventions (N807, N808). |
__checkNameToBeAvoided | Private class to check the given node for a name to be avoided (N831). |
__checkVariablesInFunction | Private method to check local variables in functions (N821). |
__error | Private method to build the error information. |
__findGlobalDefs | Private method amend a node with global definitions information. |
__getArgNames | Private method to get the argument names of a function node. |
__isNameToBeAvoided | Private method to check, if the given name should be avoided. |
__tagClassFunctions | Private method to tag functions if they are methods, class methods or static methods. |
__visitNode | Private method to inspect the given AST node. |
__visitTree | Private method to scan the given AST tree. |
run | Public method run by the pycodestyle.py checker. |
None |
Constructor (according to 'extended' pycodestyle.py API)
Private class to check the given node for class name conventions (N801).
Almost without exception, class names use the CapWords convention. Classes for internal use have a leading underscore in addition.
Private class to check the argument names of functions (N803, N804, N805, N806).
The argument names of a function should be lowercase, with words separated by underscores. A class method should have 'cls' as the first argument. A method should have 'self' as the first argument.
Private class to check the given node for function name conventions (N802).
Function names should be lowercase, with words separated by underscores as necessary to improve readability. Functions not being methods '__' in front and back are not allowed. Mixed case is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility.
Private method to check that imports don't change the naming convention (N811, N812, N813, N814).
Private method to check module naming conventions (N807, N808).
Module and package names should be lowercase.
Private class to check the given node for a name to be avoided (N831).
Private method to check local variables in functions (N821).
Local variables in functions should be lowercase.
Private method to build the error information.
Private method amend a node with global definitions information.
Private method to get the argument names of a function node.
Private method to check, if the given name should be avoided.
Private method to tag functions if they are methods, class methods or static methods.
Private method to inspect the given AST node.
Private method to scan the given AST tree.
Public method run by the pycodestyle.py checker.