fname stringlengths 63 176 | rel_fname stringclasses 706
values | line int64 -1 4.5k | name stringlengths 1 81 | kind stringclasses 2
values | category stringclasses 2
values | info stringlengths 0 77.9k ⌀ |
|---|---|---|---|---|---|---|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/newstyle.py | pylint/checkers/newstyle.py | 126 | register_checker | ref | function | linter.register_checker(NewStyleConflictChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/newstyle.py | pylint/checkers/newstyle.py | 126 | NewStyleConflictChecker | ref | function | linter.register_checker(NewStyleConflictChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 29 | NonAsciiNameChecker | def | class | _check_name visit_module visit_functiondef visit_global visit_assignname visit_classdef _check_module_import visit_import visit_importfrom visit_call |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 73 | _check_name | def | function | def _check_name(self, node_type: str, name: str | None, node: nodes.NodeNG) -> None:
"""Check whether a name is using non-ASCII characters."""
if name is None:
# For some nodes i.e. *kwargs from a dict, the name will be empty
return
if not str(name).isascii():
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 92 | add_message | ref | function | self.add_message(msg, node=node, args=args, confidence=interfaces.HIGH)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 94 | only_required_for_messages | ref | function | @utils.only_required_for_messages("non-ascii-name", "non-ascii-file-name")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 95 | visit_module | def | function | def visit_module(self, node: nodes.Module) -> None:
self._check_name("file", node.name.split(".")[-1], node)
@utils.only_required_for_messages("non-ascii-name")
def visit_functiondef(
self, node: nodes.FunctionDef | nodes.AsyncFunctionDef
) -> None:
self._check_name("function", ... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 96 | _check_name | ref | function | self._check_name("file", node.name.split(".")[-1], node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 98 | only_required_for_messages | ref | function | @utils.only_required_for_messages("non-ascii-name")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 99 | visit_functiondef | def | function | def visit_functiondef(
self, node: nodes.FunctionDef | nodes.AsyncFunctionDef
) -> None:
self._check_name("function", node.name, node)
# Check argument names
arguments = node.args
# Check position only arguments
if arguments.posonlyargs:
for pos_only... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 102 | _check_name | ref | function | self._check_name("function", node.name, node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 110 | _check_name | ref | function | self._check_name("argument", pos_only_arg.name, pos_only_arg)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 115 | _check_name | ref | function | self._check_name("argument", arg.name, arg)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 120 | _check_name | ref | function | self._check_name("argument", kwarg.name, kwarg)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 124 | only_required_for_messages | ref | function | @utils.only_required_for_messages("non-ascii-name")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 125 | visit_global | def | function | def visit_global(self, node: nodes.Global) -> None:
for name in node.names:
self._check_name("const", name, node)
@utils.only_required_for_messages("non-ascii-name")
def visit_assignname(self, node: nodes.AssignName) -> None:
"""Check module level assigned names."""
# Th... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 127 | _check_name | ref | function | self._check_name("const", name, node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 129 | only_required_for_messages | ref | function | @utils.only_required_for_messages("non-ascii-name")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 130 | visit_assignname | def | function | def visit_assignname(self, node: nodes.AssignName) -> None:
"""Check module level assigned names."""
# The NameChecker from which this Checker originates knows a lot of different
# versions of variables, i.e. constants, inline variables etc.
# To simplify we use only `variable` here,... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 136 | frame | ref | function | frame = node.frame()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 144 | _check_name | ref | function | self._check_name("variable", node.name, node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 146 | _check_name | ref | function | self._check_name("attr", node.name, node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 152 | _check_name | ref | function | self._check_name("variable", node.name, node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 154 | only_required_for_messages | ref | function | @utils.only_required_for_messages("non-ascii-name")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 155 | visit_classdef | def | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 156 | _check_name | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 158 | instance_attr_ancestors | ref | function | if not any(node.instance_attr_ancestors(attr)):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 159 | _check_name | ref | function | self._check_name("attr", attr, anodes[0])
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 161 | _check_module_import | def | function | def _check_module_import(self, node: nodes.ImportFrom | nodes.Import) -> None:
for module_name, alias in node.names:
name = alias or module_name
self._check_name("module", name, node)
@utils.only_required_for_messages("non-ascii-name", "non-ascii-module-import")
def visit_im... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 164 | _check_name | ref | function | self._check_name("module", name, node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 166 | only_required_for_messages | ref | function | @utils.only_required_for_messages("non-ascii-name", "non-ascii-module-import")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 167 | visit_import | def | function | def visit_import(self, node: nodes.Import) -> None:
self._check_module_import(node)
@utils.only_required_for_messages("non-ascii-name", "non-ascii-module-import")
def visit_importfrom(self, node: nodes.ImportFrom) -> None:
self._check_module_import(node)
@utils.only_required_for_messag... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 168 | _check_module_import | ref | function | self._check_module_import(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 170 | only_required_for_messages | ref | function | @utils.only_required_for_messages("non-ascii-name", "non-ascii-module-import")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 171 | visit_importfrom | def | function | def visit_importfrom(self, node: nodes.ImportFrom) -> None:
self._check_module_import(node)
@utils.only_required_for_messages("non-ascii-name")
def visit_call(self, node: nodes.Call) -> None:
"""Check if the used keyword args are correct."""
for keyword in node.keywords:
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 172 | _check_module_import | ref | function | self._check_module_import(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 174 | only_required_for_messages | ref | function | @utils.only_required_for_messages("non-ascii-name")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 175 | visit_call | def | function | def visit_call(self, node: nodes.Call) -> None:
"""Check if the used keyword args are correct."""
for keyword in node.keywords:
self._check_name("argument", keyword.arg, keyword)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 178 | _check_name | ref | function | self._check_name("argument", keyword.arg, keyword)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 181 | register | def | function | def register(linter: lint.PyLinter) -> None:
linter.register_checker(NonAsciiNameChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 182 | register_checker | ref | function | linter.register_checker(NonAsciiNameChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/non_ascii_names.py | pylint/checkers/non_ascii_names.py | 182 | NonAsciiNameChecker | ref | function | linter.register_checker(NonAsciiNameChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/raw_metrics.py | pylint/checkers/raw_metrics.py | 23 | report_raw_stats | def | function | def report_raw_stats(
sect,
stats: LinterStats,
old_stats: LinterStats | None,
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/raw_metrics.py | pylint/checkers/raw_metrics.py | 37 | diff_string | ref | function | diff_str = diff_string(old, total) if old else None
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/raw_metrics.py | pylint/checkers/raw_metrics.py | 45 | Table | ref | function | sect.append(Table(children=lines, cols=5, rheaders=1))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/raw_metrics.py | pylint/checkers/raw_metrics.py | 48 | RawMetricsChecker | def | class | open process_tokens |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/raw_metrics.py | pylint/checkers/raw_metrics.py | 70 | reset_code_count | ref | function | self.linter.stats.reset_code_count()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/raw_metrics.py | pylint/checkers/raw_metrics.py | 72 | process_tokens | def | function | def process_tokens(self, tokens: list[tokenize.TokenInfo]) -> None:
"""Update stats."""
i = 0
tokens = list(tokens)
while i < len(tokens):
i, lines_number, line_type = get_type(tokens, i)
self.linter.stats.code_type_count["total"] += lines_number
s... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/raw_metrics.py | pylint/checkers/raw_metrics.py | 77 | get_type | ref | function | i, lines_number, line_type = get_type(tokens, i)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/raw_metrics.py | pylint/checkers/raw_metrics.py | 85 | get_type | def | function | def get_type(
tokens: list[tokenize.TokenInfo], start_index: int
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/raw_metrics.py | pylint/checkers/raw_metrics.py | 114 | register | def | function | def register(linter: PyLinter) -> None:
linter.register_checker(RawMetricsChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/raw_metrics.py | pylint/checkers/raw_metrics.py | 115 | register_checker | ref | function | linter.register_checker(RawMetricsChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/raw_metrics.py | pylint/checkers/raw_metrics.py | 115 | RawMetricsChecker | ref | function | linter.register_checker(RawMetricsChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/__init__.py | pylint/checkers/refactoring/__init__.py | 28 | register | def | function | def register(linter: PyLinter) -> None:
linter.register_checker(RefactoringChecker(linter))
linter.register_checker(NotChecker(linter))
linter.register_checker(RecommendationChecker(linter))
linter.register_checker(ImplicitBooleanessChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/__init__.py | pylint/checkers/refactoring/__init__.py | 29 | register_checker | ref | function | linter.register_checker(RefactoringChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/__init__.py | pylint/checkers/refactoring/__init__.py | 29 | RefactoringChecker | ref | function | linter.register_checker(RefactoringChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/__init__.py | pylint/checkers/refactoring/__init__.py | 30 | register_checker | ref | function | linter.register_checker(NotChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/__init__.py | pylint/checkers/refactoring/__init__.py | 30 | NotChecker | ref | function | linter.register_checker(NotChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/__init__.py | pylint/checkers/refactoring/__init__.py | 31 | register_checker | ref | function | linter.register_checker(RecommendationChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/__init__.py | pylint/checkers/refactoring/__init__.py | 31 | RecommendationChecker | ref | function | linter.register_checker(RecommendationChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/__init__.py | pylint/checkers/refactoring/__init__.py | 32 | register_checker | ref | function | linter.register_checker(ImplicitBooleanessChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/__init__.py | pylint/checkers/refactoring/__init__.py | 32 | ImplicitBooleanessChecker | ref | function | linter.register_checker(ImplicitBooleanessChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 13 | ImplicitBooleanessChecker | def | class | visit_call instance_has_bool visit_unaryop visit_compare _check_use_implicit_booleaness_not_comparison base_names_of_instance |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 76 | only_required_for_messages | ref | function | @utils.only_required_for_messages("use-implicit-booleaness-not-len")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 77 | visit_call | def | function | def visit_call(self, node: nodes.Call) -> None:
# a len(S) call is used inside a test condition
# could be if, while, assert or if expression statement
# e.g. `if len(S):`
if not utils.is_call_of_name(node, "len"):
return
# the len() call could also be nested toge... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 81 | is_call_of_name | ref | function | if not utils.is_call_of_name(node, "len"):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 90 | is_test_condition | ref | function | if not utils.is_test_condition(node, parent):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 101 | add_message | ref | function | self.add_message("use-implicit-booleaness-not-len", node=node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 104 | infer | ref | function | instance = next(len_arg.infer())
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 108 | base_names_of_instance | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 113 | instance_has_bool | ref | function | affected_by_pep8 and not self.instance_has_bool(instance)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 115 | add_message | ref | function | self.add_message("use-implicit-booleaness-not-len", node=node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 118 | instance_has_bool | def | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 126 | only_required_for_messages | ref | function | @utils.only_required_for_messages("use-implicit-booleaness-not-len")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 127 | visit_unaryop | def | function | def visit_unaryop(self, node: nodes.UnaryOp) -> None:
"""`not len(S)` must become `not S` regardless if the parent block
is a test condition or something else (boolean expression) e.g. `if not len(S):`.
"""
if (
isinstance(node, nodes.UnaryOp)
and node.op == "... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 134 | is_call_of_name | ref | function | and utils.is_call_of_name(node.operand, "len")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 136 | add_message | ref | function | self.add_message("use-implicit-booleaness-not-len", node=node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 138 | only_required_for_messages | ref | function | @utils.only_required_for_messages("use-implicit-booleaness-not-comparison")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 139 | visit_compare | def | function | def visit_compare(self, node: nodes.Compare) -> None:
self._check_use_implicit_booleaness_not_comparison(node)
def _check_use_implicit_booleaness_not_comparison(
self, node: nodes.Compare
) -> None:
"""Check for left side and right side of the node for empty literals."""
is_... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 140 | _check_use_implicit_booleaness_not_comparison | ref | function | self._check_use_implicit_booleaness_not_comparison(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 142 | _check_use_implicit_booleaness_not_comparison | def | function | def _check_use_implicit_booleaness_not_comparison(
self, node: nodes.Compare
) -> None:
"""Check for left side and right side of the node for empty literals."""
is_left_empty_literal = utils.is_base_container(
node.left
) or utils.is_empty_dict_literal(node.left)
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 146 | is_base_container | ref | function | is_left_empty_literal = utils.is_base_container(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 148 | is_empty_dict_literal | ref | function | ) or utils.is_empty_dict_literal(node.left)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 152 | is_base_container | ref | function | is_right_empty_literal = utils.is_base_container(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 154 | is_empty_dict_literal | ref | function | ) or utils.is_empty_dict_literal(comparator)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 162 | safe_infer | ref | function | target_instance = utils.safe_infer(target_node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 165 | base_names_of_instance | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 172 | instance_has_bool | ref | function | if not is_base_comprehension_type and self.instance_has_bool(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 187 | as_string | ref | function | instance_name = f"{target_node.func.as_string()}(...)"
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 189 | as_string | ref | function | instance_name = target_node.as_string()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 199 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 209 | base_names_of_instance | def | function | def base_names_of_instance(node: bases.Uninferable | bases.Instance) -> list[str]:
"""Return all names inherited by a class instance or those returned by a function.
The inherited names include 'object'.
"""
if isinstance(node, bases.Instance):
return [node.name] + [x.na... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 215 | ancestors | ref | function | return [node.name] + [x.name for x in node.ancestors()]
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 11 | NotChecker | def | class | visit_unaryop |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 42 | only_required_for_messages | ref | function | @utils.only_required_for_messages("unneeded-not")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 43 | visit_unaryop | def | function | def visit_unaryop(self, node: nodes.UnaryOp) -> None:
if node.op != "not":
return
operand = node.operand
if isinstance(operand, nodes.UnaryOp) and operand.op == "not":
self.add_message(
"unneeded-not",
node=node,
args=(... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 49 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 52 | as_string | ref | function | args=(node.as_string(), operand.operand.as_string()),
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 52 | as_string | ref | function | args=(node.as_string(), operand.operand.as_string()),
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 63 | frame | ref | function | frame = node.frame(future=True)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.