class PrivateImportChecker(BaseChecker): (source)
Undocumented
Static Method | same |
Does the node's file's path contain the base name of `import_mod_name`? |
Method | __init__ |
Checker instances should have the linter as argument. |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Class Variable | msgs |
Undocumented |
Class Variable | name |
Name of the provider. |
Instance Variable | all |
Undocumented |
Instance Variable | populated |
Undocumented |
Static Method | _assignments |
Returns True if no assignments involve accessing `private_name`. |
Static Method | _name |
Returns true if the name exists, starts with `_`, and if len(name) > 4 it is not a dunder, i.e. it does not begin and end with two underscores. |
Method | _get |
Returns the private names from input names by a simple string check. |
Method | _get |
Removes from names any names that are used as type annotations with no other illegal usages. |
Method | _populate |
Adds to `all_used_type_annotations` all names ever used as a type annotation in the node's (nested) scopes and whether they are only used as annotation. |
Method | _populate |
Handles the possibility of an annotation either being a Name, i.e. just type, or a Subscript e.g. `Optional[type]` or an Attribute, e.g. `pylint.lint.linter`. |
Method | _populate |
Adds all names used as type annotation in the arguments and return type of the function node into the dict `all_used_type_annotations`. |
Inherited from BaseChecker
:
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 |
Undocumented |
Method | check |
Check the consistency of msgid. |
Method | close |
Called after visiting project (i.e set of modules). |
Method | create |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | open |
Called before visiting project (i.e. set of modules). |
Method | reduce |
Undocumented |
Class Variable | enabled |
Undocumented |
Class Variable | options |
Options provided by this provider. |
Class Variable | reports |
Undocumented |
Instance Variable | linter |
Undocumented |
Property | messages |
Undocumented |
Inherited from _ArgumentsProvider
(via BaseChecker
):
Method | get |
DEPRECATED: Return the dictionary defining an option given its name. |
Method | level |
Undocumented |
Method | load |
DEPRECATED: Initialize the provider using default values. |
Method | option |
DEPRECATED: Get the config attribute corresponding to opt. |
Method | option |
DEPRECATED: Get the current value for the given option. |
Method | options |
DEPRECATED. |
Method | options |
DEPRECATED: Return an iterator on options grouped by section. |
Method | set |
DEPRECATED: Method called to set an option (registered in the options list). |
Class Variable | option |
Option groups of this provider and their descriptions. |
Property | config |
Undocumented |
Property | level |
Undocumented |
Instance Variable | _arguments |
The manager that will parse and register any options provided. |
Instance Variable | _level |
Undocumented |
def same_root_dir(node:
nodes.Import|nodes.ImportFrom
, import_mod_name: str
) -> bool
:
(source)
¶
Does the node's file's path contain the base name of `import_mod_name`?
pylint.checkers.BaseChecker.__init__
Checker instances should have the linter as argument.
def visit_import(self, node:
nodes.Import
):
(source)
¶
Undocumented
def visit_importfrom(self, node:
nodes.ImportFrom
):
(source)
¶
Undocumented
def _assignments_call_private_name(assignments:
list[ nodes.AnnAssign|nodes.Assign]
, private_name: str
) -> bool
:
(source)
¶
Returns True if no assignments involve accessing `private_name`.
Returns true if the name exists, starts with `_`, and if len(name) > 4 it is not a dunder, i.e. it does not begin and end with two underscores.
nodes.Import|nodes.ImportFrom
, names: list[ str]
) -> list[ str]
:
(source)
¶
Removes from names any names that are used as type annotations with no other illegal usages.
nodes.LocalsDictNodeNG
, all_used_type_annotations: dict[ str, bool]
):
(source)
¶
Adds to `all_used_type_annotations` all names ever used as a type annotation in the node's (nested) scopes and whether they are only used as annotation.
((nodes.Attribute|nodes.Subscript)|nodes.Name)|None
, all_used_type_annotations: dict[ str, bool]
) -> str|None
:
(source)
¶
Handles the possibility of an annotation either being a Name, i.e. just type, or a Subscript e.g. `Optional[type]` or an Attribute, e.g. `pylint.lint.linter`.