class documentation

Check string literals.

Method __init__ Checker instances should have the linter as argument.
Method check_for_concatenated_strings Undocumented
Method check_for_consistent_string_delimiters Adds a message for each string using inconsistent quote delimiters.
Method process_module Process a module.
Method process_non_raw_string_token Check for bad escapes in a non-raw string.
Method process_string_token Undocumented
Method process_tokens Should be overridden by subclasses.
Method visit_assign Undocumented
Method visit_call Undocumented
Method visit_const Undocumented
Method visit_list Undocumented
Method visit_set Undocumented
Method visit_tuple Undocumented
Constant ESCAPE_CHARACTERS Undocumented
Constant UNICODE_ESCAPE_CHARACTERS Undocumented
Class Variable msgs Undocumented
Class Variable name Name of the provider.
Class Variable options Options provided by this provider.
Instance Variable string_tokens Token position -> (token value, next token).
Method _detect_u_string_prefix Check whether strings include a 'u' prefix like u'String'.
Instance Variable _unicode_literals 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 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
def __init__(self, linter: PyLinter): (source)

Checker instances should have the linter as argument.

def check_for_concatenated_strings(self, elements: Sequence[nodes.NodeNG], iterable_type: str): (source)

Undocumented

def check_for_consistent_string_delimiters(self, tokens: Iterable[tokenize.TokenInfo]): (source)

Adds a message for each string using inconsistent quote delimiters. Quote delimiters are used inconsistently if " and ' are mixed in a module's shortstrings without having done so to avoid escaping an internal quote character. Args: tokens: The tokens to be checked against for consistent usage.

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

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

def process_non_raw_string_token(self, prefix: str, string_body: str, start_row: int, string_start_col: int): (source)

Check for bad escapes in a non-raw string. prefix: lowercase string of string prefix markers ('ur'). string_body: the un-parsed body of the string, not including the quote marks. start_row: line number in the source. string_start_col: col number of the string start in the source.

def process_string_token(self, token: str, start_row: int, start_col: int): (source)

Undocumented

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

Should be overridden by subclasses.

def visit_assign(self, node: nodes.Assign): (source)

Undocumented

@only_required_for_messages('implicit-str-concat')
def visit_call(self, node: nodes.Call): (source)

Undocumented

@only_required_for_messages('redundant-u-string-prefix')
def visit_const(self, node: nodes.Const): (source)

Undocumented

@only_required_for_messages('implicit-str-concat')
def visit_list(self, node: nodes.List): (source)

Undocumented

@only_required_for_messages('implicit-str-concat')
def visit_set(self, node: nodes.Set): (source)

Undocumented

@only_required_for_messages('implicit-str-concat')
def visit_tuple(self, node: nodes.Tuple): (source)

Undocumented

ESCAPE_CHARACTERS: str = (source)

Undocumented

Value
'''abfnrtvx
\r\t\\\'"01234567'''
UNICODE_ESCAPE_CHARACTERS: str = (source)

Undocumented

Value
'uUN'

Name of the provider.

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

Options provided by this provider.

string_tokens: dict[tuple[int, int], tuple[str, tokenize.TokenInfo|None]] = (source)

Token position -> (token value, next token).

def _detect_u_string_prefix(self, node: nodes.Const): (source)

Check whether strings include a 'u' prefix like u'String'.

_unicode_literals = (source)

Undocumented