class documentation

Formatting checker. Checks for : * unauthorized constructions * strict indentation * line length

Static Method is_line_length_check_activated Return True if the line length check is activated.
Static Method remove_pylint_option_from_lines Remove the `# pylint ...` pattern from lines.
Static Method specific_splitlines Split lines according to universal newlines except those in a specific sets.
Method __init__ Checker instances should have the linter as argument.
Method check_indent_level Return the indent level of the string.
Method check_line_length Check that the line length is less than the authorized value.
Method check_lines Check given lines for potential messages.
Method check_trailing_whitespace_ending Check that there is no trailing white-space.
Method new_line A new line has been encountered, process it if necessary.
Method process_module Process a module.
Method process_tokens Process tokens and search for:
Method visit_default Check the node line number and check it if not yet done.
Class Variable name Name of the provider.
Class Variable options Options provided by this provider.
Method _check_keyword_parentheses Check that there are not unnecessary parentheses after a keyword.
Method _check_line_ending Undocumented
Method _check_multi_statement_line Check for lines containing multiple statements.
Instance Variable _last_line_ending Undocumented
Instance Variable _lines Undocumented
Instance Variable _visited_lines Undocumented

Inherited from BaseChecker (via BaseTokenChecker, BaseRawFileChecker):

Method __eq__ Permit to assert Checkers are equal.
Method __gt__ Sorting of checkers.
Method __hash__ Make Checker hashable.
Method __repr__ Undocumented
Method __str__ This might be incomplete because multiple classes inheriting BaseChecker can have the same name.
Method add_message Undocumented
Method check_consistency Check the consistency of msgid.
Method close Called after visiting project (i.e set of modules).
Method create_message_definition_from_tuple Undocumented
Method get_full_documentation Undocumented
Method get_map_data Undocumented
Method get_message_definition Undocumented
Method open Called before visiting project (i.e. set of modules).
Method reduce_map_data Undocumented
Class Variable enabled Undocumented
Class Variable msgs Undocumented
Class Variable reports Undocumented
Instance Variable linter Undocumented
Property messages Undocumented

Inherited from _ArgumentsProvider (via BaseTokenChecker, BaseRawFileChecker, BaseChecker):

Method get_option_def DEPRECATED: Return the dictionary defining an option given its name.
Method level.setter Undocumented
Method load_defaults DEPRECATED: Initialize the provider using default values.
Method option_attrname DEPRECATED: Get the config attribute corresponding to opt.
Method option_value DEPRECATED: Get the current value for the given option.
Method options_and_values DEPRECATED.
Method options_by_section DEPRECATED: Return an iterator on options grouped by section.
Method set_option DEPRECATED: Method called to set an option (registered in the options list).
Class Variable option_groups_descs Option groups of this provider and their descriptions.
Property config Undocumented
Property level Undocumented
Instance Variable _arguments_manager The manager that will parse and register any options provided.
Instance Variable _level Undocumented
@staticmethod
def is_line_length_check_activated(pylint_pattern_match_object: Match[str]) -> bool: (source)

Return True if the line length check is activated.

@staticmethod
def remove_pylint_option_from_lines(options_pattern_obj: Match[str]) -> str: (source)

Remove the `# pylint ...` pattern from lines.

@staticmethod
def specific_splitlines(lines: str) -> list[str]: (source)

Split lines according to universal newlines except those in a specific sets.

def __init__(self, linter: PyLinter): (source)

Checker instances should have the linter as argument.

def check_indent_level(self, string: str, expected: int, line_num: int): (source)

Return the indent level of the string.

def check_line_length(self, line: str, i: int, checker_off: bool): (source)

Check that the line length is less than the authorized value.

def check_lines(self, tokens: TokenWrapper, line_start: int, lines: str, lineno: int): (source)

Check given lines for potential messages. Check if lines have: - a final newline - no trailing white-space - less than a maximum number of characters

def check_trailing_whitespace_ending(self, line: str, i: int): (source)

Check that there is no trailing white-space.

def new_line(self, tokens: TokenWrapper, line_end: int, line_start: int): (source)

A new line has been encountered, process it if necessary.

def process_module(self, node: nodes.Module): (source)

Process a module. The module's content is accessible via ``astroid.stream``

def process_tokens(self, tokens: list[tokenize.TokenInfo]): (source)

Process tokens and search for: - too long lines (i.e. longer than <max_chars>) - optionally bad construct (if given, bad_construct must be a compiled regular expression).

@only_required_for_messages('multiple-statements')
def visit_default(self, node: nodes.NodeNG): (source)

Check the node line number and check it if not yet done.

Name of the provider.

options: tuple[tuple, ...] = (source)

Options provided by this provider.

def _check_keyword_parentheses(self, tokens: list[tokenize.TokenInfo], start: int): (source)

Check that there are not unnecessary parentheses after a keyword. Parens are unnecessary if there is exactly one balanced outer pair on a line and contains no commas (i.e. is not a tuple). Args: tokens: The entire list of Tokens. start: The position of the keyword in the token list.

def _check_line_ending(self, line_ending: str, line_num: int): (source)

Undocumented

def _check_multi_statement_line(self, node: nodes.NodeNG, line: int): (source)

Check for lines containing multiple statements.

_last_line_ending = (source)

Undocumented

Undocumented

_visited_lines: dict = (source)

Undocumented