Classes | Functions | Variables
roslint.pep8 Namespace Reference

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(['^', '&', '|', '<<', '>>', '%'])
 

Function Documentation

def roslint.pep8._is_eol_token (   token)
private

Definition at line 1302 of file pep8.py.

def roslint.pep8._is_eol_token (   token,
  _eol_token = _is_eol_token 
)
private

Definition at line 1305 of file pep8.py.

def roslint.pep8._main ( )
private
Parse options and run checks on Python source.

Definition at line 2091 of file pep8.py.

def roslint.pep8.blank_lines (   logical_line,
  blank_lines,
  indent_level,
  line_number,
  blank_before,
  previous_logical,
  previous_indent_level 
)

Plugins (check functions) for logical lines.

Definition at line 237 of file pep8.py.

def roslint.pep8.break_around_binary_operator (   logical_line,
  tokens 
)

Definition at line 1004 of file pep8.py.

def roslint.pep8.comparison_negative (   logical_line)

Definition at line 1077 of file pep8.py.

def roslint.pep8.comparison_to_singleton (   logical_line,
  noqa 
)

Definition at line 1043 of file pep8.py.

def roslint.pep8.comparison_type (   logical_line,
  noqa 
)

Definition at line 1098 of file pep8.py.

def roslint.pep8.compound_statements (   logical_line)

Definition at line 908 of file pep8.py.

def roslint.pep8.continued_indentation (   logical_line,
  tokens,
  indent_level,
  hang_closing,
  indent_char,
  noqa,
  verbose 
)

Definition at line 386 of file pep8.py.

def roslint.pep8.expand_indent (   line)

Definition at line 1202 of file pep8.py.

def roslint.pep8.explicit_line_join (   logical_line,
  tokens 
)

Definition at line 965 of file pep8.py.

def roslint.pep8.extraneous_whitespace (   logical_line)

Definition at line 273 of file pep8.py.

def roslint.pep8.filename_match (   filename,
  patterns,
  default = True 
)
Check if patterns contains a pattern that matches filename.

If patterns is unspecified, this always returns True.

Definition at line 1292 of file pep8.py.

def roslint.pep8.get_parser (   prog = 'pep8',
  version = __version__ 
)

Definition at line 1910 of file pep8.py.

def roslint.pep8.imports_on_separate_lines (   logical_line)

Definition at line 839 of file pep8.py.

def roslint.pep8.indentation (   logical_line,
  previous_logical,
  indent_char,
  indent_level,
  previous_indent_level 
)

Definition at line 355 of file pep8.py.

def roslint.pep8.init_checks_registry ( )
Register all globally visible functions.

The first argument name is either 'physical_line' or 'logical_line'.

Definition at line 1335 of file pep8.py.

def roslint.pep8.maximum_line_length (   physical_line,
  max_line_length,
  multiline 
)

Definition at line 198 of file pep8.py.

def roslint.pep8.missing_whitespace (   logical_line)

Definition at line 328 of file pep8.py.

def roslint.pep8.missing_whitespace_around_operator (   logical_line,
  tokens 
)

Definition at line 639 of file pep8.py.

def roslint.pep8.module_imports_on_top_of_file (   logical_line,
  indent_level,
  checker_state,
  noqa 
)

Definition at line 859 of file pep8.py.

def roslint.pep8.mute_string (   text)
Replace contents with 'xxx' to prevent syntax matching.

>>> mute_string('"abc"')
'"xxx"'
>>> mute_string("'''abc'''")
"'''xxx'''"
>>> mute_string("r'abc'")
"r'xxx'"

Definition at line 1229 of file pep8.py.

def roslint.pep8.normalize_paths (   value,
  parent = os.curdir 
)
Parse a comma-separated list of paths.

Return a list of absolute paths.

Definition at line 1274 of file pep8.py.

def roslint.pep8.parse_udiff (   diff,
  patterns = None,
  parent = '.' 
)
Return a dictionary of matching lines.

Definition at line 1249 of file pep8.py.

def roslint.pep8.process_options (   arglist = None,
  parse_argv = False,
  config_file = None,
  parser = None 
)
Process options passed either via arglist or via command line args.

Passing in the ``config_file`` parameter allows other tools, such as flake8
to specify their own options to be processed in pep8.

Definition at line 2041 of file pep8.py.

def roslint.pep8.python_3000_backticks (   logical_line)

Definition at line 1158 of file pep8.py.

def roslint.pep8.python_3000_has_key (   logical_line,
  noqa 
)

Definition at line 1121 of file pep8.py.

def roslint.pep8.python_3000_not_equal (   logical_line)

Definition at line 1145 of file pep8.py.

def roslint.pep8.python_3000_raise_comma (   logical_line)

Definition at line 1132 of file pep8.py.

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.

Definition at line 1971 of file pep8.py.

def roslint.pep8.readlines (   filename)

Helper functions.

Read the source code.

Definition at line 1176 of file pep8.py.

def roslint.pep8.register_check (   check,
  codes = None 
)
Register a new check object.

Definition at line 1317 of file pep8.py.

def roslint.pep8.stdin_get_value ( )

Definition at line 1197 of file pep8.py.

def roslint.pep8.tabs_obsolete (   physical_line)

Definition at line 150 of file pep8.py.

def roslint.pep8.tabs_or_spaces (   physical_line,
  indent_char 
)

Plugins (check functions) for physical lines.

Definition at line 131 of file pep8.py.

def roslint.pep8.trailing_blank_lines (   physical_line,
  lines,
  line_number,
  total_lines 
)

Definition at line 182 of file pep8.py.

def roslint.pep8.trailing_whitespace (   physical_line)

Definition at line 161 of file pep8.py.

def roslint.pep8.whitespace_around_comma (   logical_line)

Definition at line 731 of file pep8.py.

def roslint.pep8.whitespace_around_keywords (   logical_line)

Definition at line 305 of file pep8.py.

def roslint.pep8.whitespace_around_named_parameter_equals (   logical_line,
  tokens 
)

Definition at line 749 of file pep8.py.

def roslint.pep8.whitespace_around_operator (   logical_line)

Definition at line 616 of file pep8.py.

def roslint.pep8.whitespace_before_comment (   logical_line,
  tokens 
)

Definition at line 798 of file pep8.py.

def roslint.pep8.whitespace_before_parameters (   logical_line,
  tokens 
)

Definition at line 584 of file pep8.py.

Variable Documentation

string roslint.pep8.__version__ = '1.6.2'
private

Definition at line 65 of file pep8.py.

dictionary roslint.pep8._checks = {'physical_line': {}, 'logical_line': {}, 'tree': {}}
private

Framework to run all checks.

Definition at line 1314 of file pep8.py.

roslint.pep8.ARITHMETIC_OP = frozenset(['**', '*', '/', '//', '+', '-'])

Definition at line 92 of file pep8.py.

list roslint.pep8.BENCHMARK_KEYS = ['directories', 'files', 'logical lines', 'physical lines']

Definition at line 102 of file pep8.py.

string roslint.pep8.COMMENT_WITH_NL = '#\n'

Definition at line 123 of file pep8.py.

roslint.pep8.COMPARE_NEGATIVE_REGEX = re.compile(r'\b(not)\s+[^][)(}{ ]+\s+(in|is)\s')

Definition at line 113 of file pep8.py.

roslint.pep8.COMPARE_SINGLETON_REGEX
Initial value:
1 = re.compile(r'\b(None|False|True)?\s*([=!]=)'
2  r'\s*(?(1)|(None|False|True))\b')

Definition at line 111 of file pep8.py.

roslint.pep8.COMPARE_TYPE_REGEX
Initial value:
1 = re.compile(r'(?:[=!]=|is(?:\s+not)?)\s*type(?:s.\w+Type'
2  r'|\s*\(\s*([^)]*[^ )])\s*\))')

Definition at line 114 of file pep8.py.

string roslint.pep8.DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git,__pycache__,.tox'

Definition at line 67 of file pep8.py.

string roslint.pep8.DEFAULT_IGNORE = 'E121,E123,E126,E226,E24,E704'

Definition at line 68 of file pep8.py.

roslint.pep8.DOCSTRING_REGEX = re.compile(r'u?r?["\']')

Definition at line 108 of file pep8.py.

roslint.pep8.ERRORCODE_REGEX = re.compile(r'\b[A-Z]\d{3}\b')

Definition at line 107 of file pep8.py.

roslint.pep8.EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')

Definition at line 109 of file pep8.py.

roslint.pep8.HUNK_REGEX = re.compile(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$')

Definition at line 119 of file pep8.py.

roslint.pep8.INDENT_REGEX = re.compile(r'([ \t]*)')

Definition at line 104 of file pep8.py.

roslint.pep8.isidentifier = re.compile(r'[a-zA-Z_]\w*$').match

Definition at line 1180 of file pep8.py.

roslint.pep8.KEYWORD_REGEX = re.compile(r'(\s*)\b(?:%s)\b(\s*)' % r'|'.join(KEYWORDS))

Definition at line 116 of file pep8.py.

roslint.pep8.KEYWORDS = frozenset(keyword.kwlist + ['print'])-SINGLETONS

Definition at line 90 of file pep8.py.

roslint.pep8.LAMBDA_REGEX = re.compile(r'\blambda\b')

Definition at line 118 of file pep8.py.

int roslint.pep8.MAX_LINE_LENGTH = 79

Definition at line 82 of file pep8.py.

roslint.pep8.NEWLINE = frozenset([tokenize.NL, tokenize.NEWLINE])

Definition at line 98 of file pep8.py.

roslint.pep8.noqa = re.compile(r'# no(?:qa|pep8)\b', re.I).search

Definition at line 1199 of file pep8.py.

roslint.pep8.OPERATOR_REGEX = re.compile(r'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+)(\s*)')

Definition at line 117 of file pep8.py.

tuple roslint.pep8.PROJECT_CONFIG = ('setup.cfg', 'tox.ini', '.pep8')

Definition at line 80 of file pep8.py.

int roslint.pep8.PyCF_ONLY_AST = 1024

Definition at line 88 of file pep8.py.

roslint.pep8.RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,')

Definition at line 105 of file pep8.py.

dictionary roslint.pep8.REPORT_FORMAT
Initial value:
1 = {
2  'default': '%(path)s:%(row)d:%(col)d: %(code)s %(text)s',
3  'pylint': '%(path)s:%(row)d: [%(code)s] %(text)s',
4 }

Definition at line 83 of file pep8.py.

roslint.pep8.RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,.*,\s*\w+\s*$')

Definition at line 106 of file pep8.py.

roslint.pep8.SINGLETONS = frozenset(['False', 'None', 'True'])

Definition at line 89 of file pep8.py.

roslint.pep8.SKIP_COMMENTS = SKIP_TOKENS.union([tokenize.COMMENT, tokenize.ERRORTOKEN])

Definition at line 101 of file pep8.py.

roslint.pep8.SKIP_TOKENS = NEWLINE.union([tokenize.INDENT, tokenize.DEDENT])

Definition at line 99 of file pep8.py.

roslint.pep8.stdin_get_value = sys.stdin.read

Definition at line 1181 of file pep8.py.

roslint.pep8.TESTSUITE_PATH = os.path.join(os.path.dirname(__file__), 'testsuite')

Definition at line 81 of file pep8.py.

roslint.pep8.UNARY_OPERATORS = frozenset(['>>', '**', '*', '+', '-'])

Definition at line 91 of file pep8.py.

roslint.pep8.USER_CONFIG = os.path.expanduser(r'~\.pep8')

Definition at line 71 of file pep8.py.

roslint.pep8.WHITESPACE = frozenset(' \t')

Definition at line 97 of file pep8.py.

roslint.pep8.WHITESPACE_AFTER_COMMA_REGEX = re.compile(r'[,;:]\s*(?: |\t)')

Definition at line 110 of file pep8.py.

roslint.pep8.WS_NEEDED_OPERATORS
Initial value:
1 = frozenset([
2  '**=', '*=', '/=', '//=', '+=', '-=', '!=', '<>', '<', '>',
3  '%=', '^=', '&=', '|=', '==', '<=', '>=', '<<=', '>>=', '='])

Definition at line 94 of file pep8.py.

roslint.pep8.WS_OPTIONAL_OPERATORS = ARITHMETIC_OP.union(['^', '&', '|', '<<', '>>', '%'])

Definition at line 93 of file pep8.py.



roslint
Author(s): Mike Purvis, Jack O'Quin
autogenerated on Wed May 1 2019 02:23:59