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 eric6 IDE.
__all__ |
__version__ |
NannyNag | Class implementing an exception for indentation issues. |
Whitespace | Class implementing the whitespace checker. |
__check | Private function to check one Python source file for whitespace related problems. |
batchCheck | Module function to check a batch of files for whitespace related problems. |
check | Private function to check one Python source file for whitespace related problems. |
format_witnesses | Function to format the witnesses as a readable string. |
initBatchService | Initialize the batch service and return the entry point. |
initService | Initialize the service and return the entry point. |
process_tokens | Function processing all tokens generated by a tokenizer run. |
worker | Module function acting as the parallel worker for the style check. |
Class implementing an exception for indentation issues.
Raised by tokeneater() if detecting an ambiguous indent. Captured and handled in check().
None |
None |
NannyNag | Constructor |
get_line | Public method to retrieve the offending line. |
get_lineno | Public method to retrieve the line number. |
get_msg | Public method to retrieve the message. |
None |
Constructor
Public method to retrieve the offending line.
Public method to retrieve the line number.
Public method to retrieve the message.
Class implementing the whitespace checker.
None |
None |
Whitespace | Constructor |
equal | Public method to compare the indentation levels of two Whitespace objects for equality. |
indent_level | Public method to determine the indentation level. |
less | Public method to compare the indentation level against another Whitespace objects to be smaller. |
longest_run_of_spaces | Public method to calculate the length of longest contiguous run of spaces. |
not_equal_witness | Public method to calculate a tuple of witnessing tab size. |
not_less_witness | Public method to calculate a tuple of witnessing tab size. |
None |
Constructor
Public method to compare the indentation levels of two Whitespace objects for equality.
Public method to determine the indentation level.
Public method to compare the indentation level against another Whitespace objects to be smaller.
Public method to calculate the length of longest contiguous run of spaces.
Public 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.
Public 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.
Module function to check a batch of files for whitespace related problems.
Private function to check one Python source file for whitespace related problems.
Function to format the witnesses as a readable string.
Initialize the batch service and return the entry point.
Initialize the service and return the entry point.
Function processing all tokens generated by a tokenizer run.
Module function acting as the parallel worker for the style check.