Module implementing a checker for miscellaneous checks.
None |
MiscellaneousChecker | Class implementing a checker for miscellaneous checks. |
TextVisitor | Class implementing a node visitor for bytes and str instances. |
None |
Class implementing a checker for miscellaneous checks.
BuiltinsWhiteList |
Codes |
FormatFieldRegex |
Formatter |
None |
MiscellaneousChecker | Constructor |
__checkBuiltins | Private method to check, if built-ins are shadowed. |
__checkCoding | Private method to check the presence of a coding line and valid encodings. |
__checkComprehensions | Private method to check some comprehension related things. |
__checkCopyright | Private method to check the presence of a copyright statement. |
__checkFormatString | Private method to check string format strings. |
__checkFuture | Private method to check the __future__ imports. |
__checkMutableDefault | Private method to check for use of mutable types as default arguments. |
__checkPep3101 | Private method to check for old style string formatting. |
__checkPrintStatements | Private method to check for print statements. |
__checkTuple | Private method to check for one element tuples. |
__error | Private method to record an issue. |
__getCoding | Private method to get the defined coding of the source. |
__getFields | Private method to extract the format field information. |
__ignoreCode | Private method to check if the message code should be ignored. |
__reportInvalidSyntax | Private method to report a syntax error. |
run | Public method to check the given source against miscellaneous conditions. |
None |
Constructor
Private method to check, if built-ins are shadowed.
Private method to check the presence of a coding line and valid encodings.
Private method to check some comprehension related things.
Private method to check the presence of a copyright statement.
Private method to check string format strings.
Private method to check the __future__ imports.
Private method to check for use of mutable types as default arguments.
Private method to check for old style string formatting.
Private method to check for print statements.
Private method to check for one element tuples.
Private method to record an issue.
Private method to get the defined coding of the source.
Private method to extract the format field information.
Private method to check if the message code should be ignored.
Private method to report a syntax error.
Public method to check the given source against miscellaneous conditions.
Class implementing a node visitor for bytes and str instances.
It tries to detect docstrings as string of the first expression of each module, class or function.
None |
None |
TextVisitor | Constructor |
__addNode | Private method to add a node to our list of nodes. |
__isBaseString | Private method to determine, if a node is a base string node. |
__visitBody | Private method to traverse the body of the node manually. |
__visitDefinition | Private method handling class and function definitions. |
visit_Bytes | Public method to record a bytes node. |
visit_Call | Public method to handle a function call. |
visit_ClassDef | Public method to handle a class definition. |
visit_FunctionDef | Public method to handle a function definition. |
visit_Module | Public method to handle a module. |
visit_Str | Public method to record a string node. |
None |
Constructor
Private method to add a node to our list of nodes.
Private method to determine, if a node is a base string node.
Private method to traverse the body of the node manually.
If the first node is an expression which contains a string or bytes it marks that as a docstring.
Private method handling class and function definitions.
Public method to record a bytes node.
Public method to handle a function call.
Public method to handle a class definition.
Public method to handle a function definition.
Public method to handle a module.
Public method to record a string node.