The Tab Nanny despises ambiguous indentation. She knows no mercy.
tabnanny -- Detection of ambiguous indentation
For the time being this module is intended to be called as a script. However it is possible to import it into an IDE and use the function check() described below.
Warning: The API provided by this module is likely to change in future releases; such changes may not be backward compatible.
This is a modified version to make the original tabnanny better suitable for being called from within the eric4 IDE.
__all__ |
__version__ |
NannyNag | Raised by tokeneater() if detecting an ambiguous indent. |
Whitespace | Class implementing the whitespace checker. |
check | Private function to check one Python source file for whitespace related problems. |
format_witnesses | Function to format the witnesses as a readable string. |
process_tokens | Function processing all tokens generated by a tokenizer run. |
Raised by tokeneater() if detecting an ambiguous indent. Captured and handled in check().
None |
NannyNag | Constructor |
get_line | Method to retrieve the offending line. |
get_lineno | Method to retrieve the line number. |
get_msg | Method to retrieve the message. |
Constructor
Method to retrieve the offending line.
Method to retrieve the line number.
Method to retrieve the message.
Class implementing the whitespace checker.
None |
Whitespace | Constructor |
equal | Method to compare the indentation levels of two Whitespace objects for equality. |
indent_level | Method to determine the indentation level. |
less | Method to compare the indentation level against another Whitespace objects to be smaller. |
longest_run_of_spaces | Method to calculate the length of longest contiguous run of spaces. |
not_equal_witness | Method to calculate a tuple of witnessing tab size. |
not_less_witness | Method to calculate a tuple of witnessing tab size. |
Constructor
Method to compare the indentation levels of two Whitespace objects for equality.
Method to determine the indentation level.
Method to compare the indentation level against another Whitespace objects to be smaller.
Method to calculate the length of longest contiguous run of spaces.
Method to calculate a tuple of witnessing tab size.
Intended to be used after not self.equal(other) is known, in which case it will return at least one witnessing tab size.
Method to calculate a tuple of witnessing tab size.
Intended to be used after not self.less(other is known, in which case it will return at least one witnessing tab size.
Private function to check one Python source file for whitespace related problems.
Function to format the witnesses as a readable string.
Function processing all tokens generated by a tokenizer run.