class documentation

class NameChecker(_BasicChecker): (source)

View In Hierarchy

Undocumented

Method __init__ Checker instances should have the linter as argument.
Method leave_module Undocumented
Method open Called before visiting project (i.e. set of modules).
Method visit_assignname Check module level assigned names.
Method visit_classdef Undocumented
Method visit_functiondef Undocumented
Method visit_module Undocumented
Class Variable msgs Undocumented
Class Variable options Options provided by this provider.
Static Method _assigns_typealias Check if a node is assigning a TypeAlias.
Static Method _assigns_typevar Check if a node is assigning a TypeVar.
Method _check_name Check for a name using the type's regexp.
Method _check_typevar Check for TypeVar lint violations.
Method _create_naming_rules Undocumented
Method _find_name_group Undocumented
Method _name_allowed_by_regex Undocumented
Method _name_disallowed_by_regex Undocumented
Method _raise_name_warning Undocumented
Method _recursive_check_names Check names in a possibly recursive list <arg>.
Class Variable _options Undocumented
Instance Variable _bad_names Undocumented
Instance Variable _bad_names_rgxs_compiled Undocumented
Instance Variable _good_names_rgxs_compiled Undocumented
Instance Variable _name_group Undocumented
Instance Variable _name_hints Undocumented
Instance Variable _name_regexps Undocumented

Inherited from _BasicChecker:

Class Variable name Name of the provider.

Inherited from BaseChecker (via _BasicChecker):

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 reduce_map_data Undocumented
Class Variable enabled Undocumented
Class Variable reports Undocumented
Instance Variable linter Undocumented
Property messages Undocumented

Inherited from _ArgumentsProvider (via _BasicChecker, 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 leave_module(self, _: nodes.Module): (source)

Undocumented

def open(self): (source)

Called before visiting project (i.e. set of modules).

@utils.only_required_for_messages('disallowed-name', 'invalid-name', 'typevar-name-incorrect-variance', 'typevar-double-variance', 'typevar-name-mismatch')
def visit_assignname(self, node: nodes.AssignName): (source)

Check module level assigned names.

@utils.only_required_for_messages('disallowed-name', 'invalid-name')
def visit_classdef(self, node: nodes.ClassDef): (source)

Undocumented

@utils.only_required_for_messages('disallowed-name', 'invalid-name')
def visit_functiondef(self, node: nodes.FunctionDef): (source)

Undocumented

@utils.only_required_for_messages('disallowed-name', 'invalid-name')
def visit_module(self, node: nodes.Module): (source)

Undocumented

options: Options = (source)

Options provided by this provider.

@staticmethod
def _assigns_typealias(node: nodes.NodeNG|None) -> bool: (source)

Check if a node is assigning a TypeAlias.

@staticmethod
def _assigns_typevar(node: nodes.NodeNG|None) -> bool: (source)

Check if a node is assigning a TypeVar.

def _check_name(self, node_type: str, name: str, node: nodes.NodeNG, confidence: interfaces.Confidence = interfaces.HIGH, disallowed_check_only: bool = False): (source)

Check for a name using the type's regexp.

def _check_typevar(self, name: str, node: nodes.AssignName): (source)

Check for TypeVar lint violations.

def _create_naming_rules(self) -> tuple[dict[str, Pattern[str]], dict[str, str]]: (source)

Undocumented

def _find_name_group(self, node_type: str) -> str: (source)

Undocumented

def _name_allowed_by_regex(self, name: str) -> bool: (source)

Undocumented

def _name_disallowed_by_regex(self, name: str) -> bool: (source)

Undocumented

def _raise_name_warning(self, prevalent_group: str|None, node: nodes.NodeNG, node_type: str, name: str, confidence: interfaces.Confidence, warning: str = 'invalid-name'): (source)

Undocumented

def _recursive_check_names(self, args: list[nodes.AssignName]): (source)

Check names in a possibly recursive list <arg>.

_options: Options = (source)

Undocumented

_bad_names: dict = (source)

Undocumented

_bad_names_rgxs_compiled = (source)

Undocumented

_good_names_rgxs_compiled = (source)

Undocumented

_name_group: dict[str, str] = (source)

Undocumented

_name_hints = (source)

Undocumented

_name_regexps = (source)

Undocumented