File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,4 +70,6 @@ exclude = [".venv"]
7070show-source = true
7171
7272[tool .coverage .report ]
73- exclude_also = [" if typing.TYPE_CHECKING:" ]
73+ skip_covered = true
74+ show_missing = true
75+ exclude_also = [" if TYPE_CHECKING:" ]
Original file line number Diff line number Diff line change 22import ast
33import typing
44
5- from community_of_python_flake8_plugin .constants import VERB_PREFIXES
65from community_of_python_flake8_plugin .violation_codes import ViolationCodes
76from community_of_python_flake8_plugin .violations import Violation
87
98
10- def check_is_verb_name (identifier : str ) -> bool :
11- return any (identifier == verb or identifier .startswith (f"{ verb } _" ) for verb in VERB_PREFIXES )
12-
13-
149@typing .final
1510class AsyncGetPrefixCheck (ast .NodeVisitor ):
1611 def __init__ (self , syntax_tree : ast .AST ) -> None : # noqa: ARG002
Original file line number Diff line number Diff line change 99
1010
1111def check_is_ignored_name (identifier : str ) -> bool :
12- if identifier == "_" :
13- return True
14- if identifier .isupper ():
15- return True
16- if identifier in {"value" , "values" , "pattern" }:
12+ if identifier == "main" :
1713 return True
1814 if identifier .startswith ("__" ) and identifier .endswith ("__" ):
1915 return True
@@ -78,9 +74,7 @@ def validate_function_name(
7874 self , ast_node : ast .FunctionDef | ast .AsyncFunctionDef , parent_class : ast .ClassDef | None
7975 ) -> None :
8076 if (
81- ast_node .name == "main"
82- or (ast_node .name .startswith ("__" ) and ast_node .name .endswith ("__" ))
83- or check_is_ignored_name (ast_node .name )
77+ check_is_ignored_name (ast_node .name )
8478 or (parent_class and self .check_inherits_from_whitelisted_class (parent_class ))
8579 or check_is_property (ast_node )
8680 or check_is_pytest_fixture (ast_node )
You can’t perform that action at this time.
0 commit comments