Skip to content

Commit 18f63e1

Browse files
committed
Reorder imports and add noqa comment for COP004G violation
1 parent b1f5861 commit 18f63e1

8 files changed

Lines changed: 17 additions & 9 deletions

File tree

src/community_of_python_flake8_plugin/checks/async_get_prefix.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
import typing
44

55
from community_of_python_flake8_plugin.constants import VERB_PREFIXES
6+
from community_of_python_flake8_plugin.violation_codes import ViolationCodes
67
from community_of_python_flake8_plugin.violations import Violation
78

8-
from community_of_python_flake8_plugin.violation_codes import ViolationCodes
9+
910
def check_is_verb_name(identifier: str) -> bool:
1011
return any(identifier == verb or identifier.startswith(f"{verb}_") for verb in VERB_PREFIXES)
1112

src/community_of_python_flake8_plugin/checks/dataclass_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
import typing
44

55
from community_of_python_flake8_plugin.constants import FINAL_CLASS_EXCLUDED_BASES
6-
from community_of_python_flake8_plugin.violations import Violation
76
from community_of_python_flake8_plugin.violation_codes import ViolationCodes
7+
from community_of_python_flake8_plugin.violations import Violation
8+
89

910
def is_dataclass_decorator(decorator: ast.expr) -> bool:
1011
"""Check if the decorator is a dataclass decorator."""

src/community_of_python_flake8_plugin/checks/final_class.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import ast
33
import typing
44

5+
from community_of_python_flake8_plugin.violation_codes import ViolationCodes
56
from community_of_python_flake8_plugin.violations import Violation
67

7-
from community_of_python_flake8_plugin.violation_codes import ViolationCodes
8+
89
def contains_final_decorator(class_node: ast.ClassDef) -> bool:
910
for decorator in class_node.decorator_list:
1011
target_name = decorator.func if isinstance(decorator, ast.Call) else decorator

src/community_of_python_flake8_plugin/checks/function_verb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
from community_of_python_flake8_plugin.constants import FINAL_CLASS_EXCLUDED_BASES, VERB_PREFIXES
66
from community_of_python_flake8_plugin.utils import find_parent_class_definition
7-
from community_of_python_flake8_plugin.violations import Violation
87
from community_of_python_flake8_plugin.violation_codes import ViolationCodes
8+
from community_of_python_flake8_plugin.violations import Violation
9+
910

1011
def check_is_ignored_name(identifier: str) -> bool:
1112
if identifier == "_":

src/community_of_python_flake8_plugin/checks/mapping_proxy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
import typing
44

55
from community_of_python_flake8_plugin.constants import MAPPING_PROXY_TYPES
6+
from community_of_python_flake8_plugin.violation_codes import ViolationCodes
67
from community_of_python_flake8_plugin.violations import Violation
78

8-
from community_of_python_flake8_plugin.violation_codes import ViolationCodes
9+
910
def is_mapping_proxy_type(annotation: ast.expr | None) -> bool:
1011
if annotation is None:
1112
return False

src/community_of_python_flake8_plugin/checks/name_length.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
from community_of_python_flake8_plugin.constants import FINAL_CLASS_EXCLUDED_BASES, MIN_NAME_LENGTH
66
from community_of_python_flake8_plugin.utils import find_parent_class_definition
7-
from community_of_python_flake8_plugin.violations import Violation
87
from community_of_python_flake8_plugin.violation_codes import ViolationCodes
8+
from community_of_python_flake8_plugin.violations import Violation
9+
910

1011
def check_is_ignored_name(identifier: str) -> bool:
1112
if identifier == "_":

src/community_of_python_flake8_plugin/checks/scalar_annotation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
from community_of_python_flake8_plugin.constants import SCALAR_ANNOTATIONS
66
from community_of_python_flake8_plugin.utils import find_parent_class_definition, find_parent_function
7-
from community_of_python_flake8_plugin.violations import Violation
87
from community_of_python_flake8_plugin.violation_codes import ViolationCodes
8+
from community_of_python_flake8_plugin.violations import Violation
9+
910

1011
def check_is_literal_value(node_value: ast.AST) -> bool:
1112
if isinstance(node_value, ast.Constant):
@@ -37,7 +38,7 @@ def check_is_scalar_annotation(annotation_node: ast.AST) -> bool:
3738

3839
@typing.final
3940
class ScalarAnnotationCheck(ast.NodeVisitor):
40-
def __init__(self, tree: ast.AST) -> None:
41+
def __init__(self, tree: ast.AST) -> None: # noqa: COP004G
4142
self.violations: list[Violation] = []
4243
self.syntax_tree: typing.Final[ast.AST] = tree
4344

src/community_of_python_flake8_plugin/checks/temp_var.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
import typing
44
from collections import defaultdict
55

6-
from community_of_python_flake8_plugin.violations import Violation
76
from community_of_python_flake8_plugin.violation_codes import ViolationCodes
7+
from community_of_python_flake8_plugin.violations import Violation
8+
89

910
def collect_variable_usage(function_node: ast.AST) -> dict[str, list[ast.Name]]:
1011
variable_usage: typing.Final[defaultdict[str, list[ast.Name]]] = defaultdict(list)

0 commit comments

Comments
 (0)