Classes | |
class | BaseReport |
class | Checker |
class | DiffReport |
class | FileReport |
class | StandardReport |
class | StyleGuide |
Functions | |
def | _is_eol_token (token) |
def | _is_eol_token (token, _eol_token=_is_eol_token) |
def | _main () |
def | blank_lines (logical_line, blank_lines, indent_level, line_number, blank_before, previous_logical, previous_indent_level) |
Plugins (check functions) for logical lines. More... | |
def | break_around_binary_operator (logical_line, tokens) |
def | comparison_negative (logical_line) |
def | comparison_to_singleton (logical_line, noqa) |
def | comparison_type (logical_line, noqa) |
def | compound_statements (logical_line) |
def | continued_indentation (logical_line, tokens, indent_level, hang_closing, indent_char, noqa, verbose) |
def | expand_indent (line) |
def | explicit_line_join (logical_line, tokens) |
def | extraneous_whitespace (logical_line) |
def | filename_match (filename, patterns, default=True) |
def | get_parser (prog='pep8', version=__version__) |
def | imports_on_separate_lines (logical_line) |
def | indentation (logical_line, previous_logical, indent_char, indent_level, previous_indent_level) |
def | init_checks_registry () |
def | maximum_line_length (physical_line, max_line_length, multiline) |
def | missing_whitespace (logical_line) |
def | missing_whitespace_around_operator (logical_line, tokens) |
def | module_imports_on_top_of_file (logical_line, indent_level, checker_state, noqa) |
def | mute_string (text) |
def | normalize_paths (value, parent=os.curdir) |
def | parse_udiff (diff, patterns=None, parent='.') |
def | process_options (arglist=None, parse_argv=False, config_file=None, parser=None) |
def | python_3000_backticks (logical_line) |
def | python_3000_has_key (logical_line, noqa) |
def | python_3000_not_equal (logical_line) |
def | python_3000_raise_comma (logical_line) |
def | read_config (options, args, arglist, parser) |
def | readlines (filename) |
Helper functions. More... | |
def | register_check (check, codes=None) |
def | stdin_get_value () |
def | tabs_obsolete (physical_line) |
def | tabs_or_spaces (physical_line, indent_char) |
Plugins (check functions) for physical lines. More... | |
def | trailing_blank_lines (physical_line, lines, line_number, total_lines) |
def | trailing_whitespace (physical_line) |
def | whitespace_around_comma (logical_line) |
def | whitespace_around_keywords (logical_line) |
def | whitespace_around_named_parameter_equals (logical_line, tokens) |
def | whitespace_around_operator (logical_line) |
def | whitespace_before_comment (logical_line, tokens) |
def | whitespace_before_parameters (logical_line, tokens) |
Variables | |
string | __version__ = '1.6.2' |
dictionary | _checks = {'physical_line': {}, 'logical_line': {}, 'tree': {}} |
Framework to run all checks. More... | |
ARITHMETIC_OP = frozenset(['**', '*', '/', '//', '+', '-']) | |
list | BENCHMARK_KEYS = ['directories', 'files', 'logical lines', 'physical lines'] |
string | COMMENT_WITH_NL = '#\n' |
COMPARE_NEGATIVE_REGEX = re.compile(r'\b(not)\s+[^][)(}{ ]+\s+(in|is)\s') | |
COMPARE_SINGLETON_REGEX | |
COMPARE_TYPE_REGEX | |
string | DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git,__pycache__,.tox' |
string | DEFAULT_IGNORE = 'E121,E123,E126,E226,E24,E704' |
DOCSTRING_REGEX = re.compile(r'u?r?["\']') | |
ERRORCODE_REGEX = re.compile(r'\b[A-Z]\d{3}\b') | |
EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]') | |
HUNK_REGEX = re.compile(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$') | |
INDENT_REGEX = re.compile(r'([ \t]*)') | |
isidentifier = re.compile(r'[a-zA-Z_]\w*$').match | |
KEYWORD_REGEX = re.compile(r'(\s*)\b(?:%s)\b(\s*)' % r'|'.join(KEYWORDS)) | |
KEYWORDS = frozenset(keyword.kwlist + ['print'])-SINGLETONS | |
LAMBDA_REGEX = re.compile(r'\blambda\b') | |
int | MAX_LINE_LENGTH = 79 |
NEWLINE = frozenset([tokenize.NL, tokenize.NEWLINE]) | |
noqa = re.compile(r'# no(?:qa|pep8)\b', re.I).search | |
OPERATOR_REGEX = re.compile(r'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+)(\s*)') | |
tuple | PROJECT_CONFIG = ('setup.cfg', 'tox.ini', '.pep8') |
int | PyCF_ONLY_AST = 1024 |
RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,') | |
dictionary | REPORT_FORMAT |
RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,.*,\s*\w+\s*$') | |
SINGLETONS = frozenset(['False', 'None', 'True']) | |
SKIP_COMMENTS = SKIP_TOKENS.union([tokenize.COMMENT, tokenize.ERRORTOKEN]) | |
SKIP_TOKENS = NEWLINE.union([tokenize.INDENT, tokenize.DEDENT]) | |
stdin_get_value = sys.stdin.read | |
TESTSUITE_PATH = os.path.join(os.path.dirname(__file__), 'testsuite') | |
UNARY_OPERATORS = frozenset(['>>', '**', '*', '+', '-']) | |
USER_CONFIG = os.path.expanduser(r'~\.pep8') | |
WHITESPACE = frozenset(' \t') | |
WHITESPACE_AFTER_COMMA_REGEX = re.compile(r'[,;:]\s*(?: |\t)') | |
WS_NEEDED_OPERATORS | |
WS_OPTIONAL_OPERATORS = ARITHMETIC_OP.union(['^', '&', '|', '<<', '>>', '%']) | |
|
private |
|
private |
def roslint.pep8.blank_lines | ( | logical_line, | |
blank_lines, | |||
indent_level, | |||
line_number, | |||
blank_before, | |||
previous_logical, | |||
previous_indent_level | |||
) |
def roslint.pep8.break_around_binary_operator | ( | logical_line, | |
tokens | |||
) |
def roslint.pep8.comparison_to_singleton | ( | logical_line, | |
noqa | |||
) |
def roslint.pep8.continued_indentation | ( | logical_line, | |
tokens, | |||
indent_level, | |||
hang_closing, | |||
indent_char, | |||
noqa, | |||
verbose | |||
) |
def roslint.pep8.explicit_line_join | ( | logical_line, | |
tokens | |||
) |
def roslint.pep8.filename_match | ( | filename, | |
patterns, | |||
default = True |
|||
) |
def roslint.pep8.get_parser | ( | prog = 'pep8' , |
|
version = __version__ |
|||
) |
def roslint.pep8.indentation | ( | logical_line, | |
previous_logical, | |||
indent_char, | |||
indent_level, | |||
previous_indent_level | |||
) |
def roslint.pep8.init_checks_registry | ( | ) |
def roslint.pep8.maximum_line_length | ( | physical_line, | |
max_line_length, | |||
multiline | |||
) |
def roslint.pep8.missing_whitespace_around_operator | ( | logical_line, | |
tokens | |||
) |
def roslint.pep8.module_imports_on_top_of_file | ( | logical_line, | |
indent_level, | |||
checker_state, | |||
noqa | |||
) |
def roslint.pep8.mute_string | ( | text | ) |
def roslint.pep8.normalize_paths | ( | value, | |
parent = os.curdir |
|||
) |
def roslint.pep8.parse_udiff | ( | diff, | |
patterns = None , |
|||
parent = '.' |
|||
) |
def roslint.pep8.process_options | ( | arglist = None , |
|
parse_argv = False , |
|||
config_file = None , |
|||
parser = None |
|||
) |
def roslint.pep8.python_3000_has_key | ( | logical_line, | |
noqa | |||
) |
def roslint.pep8.read_config | ( | options, | |
args, | |||
arglist, | |||
parser | |||
) |
Read and parse configurations If a config file is specified on the command line with the "--config" option, then only it is used for configuration. Otherwise, the user configuration (~/.config/pep8) and any local configurations in the current directory or above will be merged together (in that order) using the read method of ConfigParser.
def roslint.pep8.readlines | ( | filename | ) |
def roslint.pep8.register_check | ( | check, | |
codes = None |
|||
) |
def roslint.pep8.tabs_or_spaces | ( | physical_line, | |
indent_char | |||
) |
def roslint.pep8.trailing_blank_lines | ( | physical_line, | |
lines, | |||
line_number, | |||
total_lines | |||
) |
def roslint.pep8.whitespace_around_named_parameter_equals | ( | logical_line, | |
tokens | |||
) |
def roslint.pep8.whitespace_before_comment | ( | logical_line, | |
tokens | |||
) |
def roslint.pep8.whitespace_before_parameters | ( | logical_line, | |
tokens | |||
) |
|
private |
roslint.pep8.ARITHMETIC_OP = frozenset(['**', '*', '/', '//', '+', '-']) |
list roslint.pep8.BENCHMARK_KEYS = ['directories', 'files', 'logical lines', 'physical lines'] |
roslint.pep8.COMPARE_NEGATIVE_REGEX = re.compile(r'\b(not)\s+[^][)(}{ ]+\s+(in|is)\s') |
roslint.pep8.COMPARE_SINGLETON_REGEX |
roslint.pep8.COMPARE_TYPE_REGEX |
string roslint.pep8.DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git,__pycache__,.tox' |
string roslint.pep8.DEFAULT_IGNORE = 'E121,E123,E126,E226,E24,E704' |
roslint.pep8.ERRORCODE_REGEX = re.compile(r'\b[A-Z]\d{3}\b') |
roslint.pep8.EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]') |
roslint.pep8.HUNK_REGEX = re.compile(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$') |
roslint.pep8.isidentifier = re.compile(r'[a-zA-Z_]\w*$').match |
roslint.pep8.KEYWORD_REGEX = re.compile(r'(\s*)\b(?:%s)\b(\s*)' % r'|'.join(KEYWORDS)) |
roslint.pep8.KEYWORDS = frozenset(keyword.kwlist + ['print'])-SINGLETONS |
roslint.pep8.NEWLINE = frozenset([tokenize.NL, tokenize.NEWLINE]) |
roslint.pep8.noqa = re.compile(r'# no(?:qa|pep8)\b', re.I).search |
roslint.pep8.OPERATOR_REGEX = re.compile(r'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+)(\s*)') |
tuple roslint.pep8.PROJECT_CONFIG = ('setup.cfg', 'tox.ini', '.pep8') |
roslint.pep8.RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,') |
dictionary roslint.pep8.REPORT_FORMAT |
roslint.pep8.RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,.*,\s*\w+\s*$') |
roslint.pep8.SINGLETONS = frozenset(['False', 'None', 'True']) |
roslint.pep8.SKIP_COMMENTS = SKIP_TOKENS.union([tokenize.COMMENT, tokenize.ERRORTOKEN]) |
roslint.pep8.SKIP_TOKENS = NEWLINE.union([tokenize.INDENT, tokenize.DEDENT]) |
roslint.pep8.TESTSUITE_PATH = os.path.join(os.path.dirname(__file__), 'testsuite') |
roslint.pep8.UNARY_OPERATORS = frozenset(['>>', '**', '*', '+', '-']) |
roslint.pep8.WHITESPACE_AFTER_COMMA_REGEX = re.compile(r'[,;:]\s*(?: |\t)') |
roslint.pep8.WS_NEEDED_OPERATORS |