package documentation

Some various utilities and helper classes, most of them used in the main pylint class.

Module ast_walker Undocumented
Module docs Various helper functions to create the docs of a linter object.
Module file_state Undocumented
Module linterstats No module docstring; 5/5 classes documented
Module pragma_parser No module docstring; 0/7 constant, 0/2 function, 3/3 exceptions, 0/1 class documented
Module utils No module docstring; 0/7 type alias, 0/1 type variable, 0/2 constant, 2/3 functions documented

From __init__.py:

Class ASTWalker No class docstring; 0/5 instance variable, 2/4 methods documented
Class FileState Hold internal state specific to the currently analyzed file.
Class IsortDriver A wrapper around isort API that changed between versions 4 and 5.
Class LinterStats Class used to linter stats.
Class ModuleStats TypedDict to store counts of types of messages and statements.
Function decoding_stream Undocumented
Function diff_string Given an old and new int value, return a string representing the difference.
Function format_section Format an option's section using the INI format.
Function get_global_option DEPRECATED: Retrieve an option defined by the given *checker* or by all known option providers.
Function get_module_and_frameid Return the module name and the frame id in the module.
Function get_rst_section Format an option's section using as a ReStructuredText formatted output.
Function get_rst_title Permit to get a title formatted as ReStructuredText test (underlined with a chosen character).
Function merge_stats Used to merge multiple stats objects into a new one when pylint is run in parallel mode.
Function normalize_text Wrap the text on the given line length.
Function print_full_documentation Output a full documentation in ReST format.
Function register_plugins Load all module and package in the given directory, looking for a 'register' function in each one, used to register pylint checkers.
Function tokenize_module Undocumented
Constant HAS_ISORT_5 Undocumented
Function _check_csv Undocumented
Function _format_option_value Return the user input's value from a 'compiled' value.
Function _splitstrip Return a list of stripped string by splitting the string given as argument on `sep` (',' by default), empty strings are discarded.
Function _unquote Remove optional quotes (simple or double) from the string.
def print_full_documentation(linter: PyLinter, stream: TextIO = sys.stdout, show_options: bool = True): (source)

Output a full documentation in ReST format.

def merge_stats(stats: list[LinterStats]) -> LinterStats: (source)

Used to merge multiple stats objects into a new one when pylint is run in parallel mode.

HAS_ISORT_5: bool = (source)

Undocumented

Value
True
def _check_csv(value: (list[str]|tuple[str])|str) -> Sequence[str]: (source)

Undocumented

def _format_option_value(optdict: OptionDict, value: Any) -> str: (source)

Return the user input's value from a 'compiled' value. TODO: 3.0: Remove deprecated function

def _splitstrip(string: str, sep: str = ',') -> list[str]: (source)

Return a list of stripped string by splitting the string given as argument on `sep` (',' by default), empty strings are discarded. >>> _splitstrip('a, b, c , 4,,') ['a', 'b', 'c', '4'] >>> _splitstrip('a') ['a'] >>> _splitstrip('a, b, c,') ['a', 'b', 'c'] :type string: str or unicode :param string: a csv line :type sep: str or unicode :param sep: field separator, default to the comma (',') :rtype: str or unicode :return: the unquoted string (or the input string if it wasn't quoted)

def _unquote(string: str) -> str: (source)

Remove optional quotes (simple or double) from the string. :param string: an optionally quoted string :return: the unquoted string (or the input string if it wasn't quoted)

def decoding_stream(stream: BufferedReader|BytesIO, encoding: str, errors: Literal['strict'] = 'strict') -> codecs.StreamReader: (source)

Undocumented

def diff_string(old: int|float, new: int|float) -> str: (source)

Given an old and new int value, return a string representing the difference.

def format_section(stream: TextIO, section: str, options: list[tuple[str, OptionDict, Any]], doc: str|None = None): (source)

Format an option's section using the INI format.

@overload
def get_global_option(checker: BaseChecker, option: GLOBAL_OPTION_BOOL, default: bool|None = ...) -> bool:
@overload
def get_global_option(checker: BaseChecker, option: GLOBAL_OPTION_INT, default: int|None = ...) -> int:
@overload
def get_global_option(checker: BaseChecker, option: GLOBAL_OPTION_LIST, default: list[str]|None = ...) -> list[str]:
@overload
def get_global_option(checker: BaseChecker, option: GLOBAL_OPTION_PATTERN, default: Pattern[str]|None = ...) -> Pattern[str]:
@overload
def get_global_option(checker: BaseChecker, option: GLOBAL_OPTION_PATTERN_LIST, default: list[Pattern[str]]|None = ...) -> list[Pattern[str]]:
@overload
def get_global_option(checker: BaseChecker, option: GLOBAL_OPTION_TUPLE_INT, default: tuple[int, ...]|None = ...) -> tuple[int, ...]:
(source)

DEPRECATED: Retrieve an option defined by the given *checker* or by all known option providers. It will look in the list of all options providers until the given *option* will be found. If the option wasn't found, the *default* value will be returned.

def get_module_and_frameid(node: nodes.NodeNG) -> tuple[str, str]: (source)

Return the module name and the frame id in the module.

def get_rst_section(section: str|None, options: list[tuple[str, OptionDict, Any]], doc: str|None = None) -> str: (source)

Format an option's section using as a ReStructuredText formatted output.

def get_rst_title(title: str, character: str) -> str: (source)

Permit to get a title formatted as ReStructuredText test (underlined with a chosen character).

def normalize_text(text: str, line_len: int = DEFAULT_LINE_LENGTH, indent: str = '') -> str: (source)

Wrap the text on the given line length.

def register_plugins(linter: PyLinter, directory: str): (source)

Load all module and package in the given directory, looking for a 'register' function in each one, used to register pylint checkers.

def tokenize_module(node: nodes.Module) -> list[tokenize.TokenInfo]: (source)

Undocumented