Checker for use of Python logging.
Class |
|
Checks use of the logging module. |
Function | is |
Return whether the node represents a string with complex formatting specs. |
Function | is |
Determines if a BoundMethod node represents a method call. |
Function | register |
Undocumented |
Function | str |
Determine whether the node represents an f-string with string formatting. |
Constant | CHECKED |
Undocumented |
Constant | MOST |
Undocumented |
Constant | MSGS |
Undocumented |
Function | _count |
Counts the number of tokens in an args list. |
bases.BoundMethod
, types: tuple[ str, ...]
= (), methods: tuple[ str, ...]
= ()) -> bool
:
(source)
¶
Determines if a BoundMethod node represents a method call. Args: func: The BoundMethod AST node to check. types: Optional sequence of caller type names to restrict check. methods: Optional sequence of method names to restrict check. Returns: true if the node represents a method call for the given type and method names, False otherwise.
Determine whether the node represents an f-string with string formatting. For example: `f'Hello %s'`
Undocumented
Value |
|
Counts the number of tokens in an args list. The Python log functions allow for special keyword arguments: func, exc_info and extra. To handle these cases correctly, we only count arguments that aren't keywords. Args: args: AST nodes that are arguments for a log format string. Returns: Number of AST nodes that aren't keywords.