Skip to content

Commit a3c2bc9

Browse files
Евгений БлиновЕвгений Блинов
authored andcommitted
Remove noqa: A005 from transfunctions files
1 parent c68f94b commit a3c2bc9

5 files changed

Lines changed: 19 additions & 21 deletions

File tree

tests/typing/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
# noqa: A005

transfunctions/__init__.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
from transfunctions.decorators.superfunction import (
2-
superfunction as superfunction, # noqa: PLC0414
2+
superfunction as superfunction,
33
)
44
from transfunctions.decorators.transfunction import (
5-
transfunction as transfunction, # noqa: PLC0414
5+
transfunction as transfunction,
66
)
77
from transfunctions.errors import (
8-
CallTransfunctionDirectlyError as CallTransfunctionDirectlyError, # noqa: PLC0414
8+
CallTransfunctionDirectlyError as CallTransfunctionDirectlyError,
99
)
1010
from transfunctions.errors import (
11-
DualUseOfDecoratorError as DualUseOfDecoratorError, # noqa: PLC0414
11+
DualUseOfDecoratorError as DualUseOfDecoratorError,
1212
)
1313
from transfunctions.errors import (
14-
WrongDecoratorSyntaxError as WrongDecoratorSyntaxError, # noqa: PLC0414
14+
WrongDecoratorSyntaxError as WrongDecoratorSyntaxError,
1515
)
1616
from transfunctions.errors import (
17-
WrongMarkerSyntaxError as WrongMarkerSyntaxError, # noqa: PLC0414
17+
WrongMarkerSyntaxError as WrongMarkerSyntaxError,
1818
)
1919
from transfunctions.errors import (
20-
WrongTransfunctionSyntaxError as WrongTransfunctionSyntaxError, # noqa: PLC0414
20+
WrongTransfunctionSyntaxError as WrongTransfunctionSyntaxError,
2121
)
2222
from transfunctions.markers import (
23-
async_context as async_context, # noqa: PLC0414
23+
async_context as async_context,
2424
)
2525
from transfunctions.markers import (
26-
await_it as await_it, # noqa: PLC0414
26+
await_it as await_it,
2727
)
2828
from transfunctions.markers import (
29-
generator_context as generator_context, # noqa: PLC0414
29+
generator_context as generator_context,
3030
)
3131
from transfunctions.markers import (
32-
sync_context as sync_context, # noqa: PLC0414
32+
sync_context as sync_context,
3333
)
3434
from transfunctions.markers import (
35-
yield_from_it as yield_from_it, # noqa: PLC0414
35+
yield_from_it as yield_from_it,
3636
)

transfunctions/decorators/superfunction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def decorator(function: Callable[FunctionParams, ReturnType]) -> Callable[Functi
125125

126126
if not tilde_syntax:
127127
class NoReturns(NodeTransformer):
128-
def visit_Return(self, node: Return) -> Optional[Union[AST, List[AST]]]: # noqa: ARG002, N802
128+
def visit_Return(self, node: Return) -> Optional[Union[AST, List[AST]]]: # noqa: ARG002
129129
raise WrongTransfunctionSyntaxError('A superfunction cannot contain a return statement.')
130130
transformer.get_usual_function(addictional_transformers=[NoReturns()])
131131

@@ -137,7 +137,7 @@ def wrapper(*args: FunctionParams.args, **kwargs: FunctionParams.kwargs) -> Usag
137137

138138
return wrapper
139139

140-
if len(args):
140+
if args:
141141
return decorator(args[0])
142142

143143
return decorator

transfunctions/transformer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def get_async_function(self) -> Callable[FunctionParams, Coroutine[Any, Any, Ret
9090
original_function = self.function
9191

9292
class ConvertSyncFunctionToAsync(NodeTransformer):
93-
def visit_FunctionDef(self, node: FunctionDef) -> Union[FunctionDef, AsyncFunctionDef]: # noqa: N802
93+
def visit_FunctionDef(self, node: FunctionDef) -> Union[FunctionDef, AsyncFunctionDef]:
9494
if node.name == original_function.__name__:
9595
return AsyncFunctionDef( # type: ignore[no-any-return, call-overload, unused-ignore]
9696
name=original_function.__name__,
@@ -105,7 +105,7 @@ def visit_FunctionDef(self, node: FunctionDef) -> Union[FunctionDef, AsyncFuncti
105105
return node
106106

107107
class ExtractAwaitExpressions(NodeTransformer):
108-
def visit_Call(self, node: Call) -> Union[Call, Await]: # noqa: N802
108+
def visit_Call(self, node: Call) -> Union[Call, Await]:
109109
if isinstance(node.func, Name) and node.func.id == 'await_it':
110110
if len(node.args) != 1 or node.keywords:
111111
raise WrongMarkerSyntaxError('The "await_it" marker can be used with only one positional argument.')
@@ -132,7 +132,7 @@ def visit_Call(self, node: Call) -> Union[Call, Await]: # noqa: N802
132132

133133
def get_generator_function(self) -> Callable[FunctionParams, Generator[ReturnType, None, None]]:
134134
class ConvertYieldFroms(NodeTransformer):
135-
def visit_Call(self, node: Call) -> Optional[Union[AST, List[AST]]]: # noqa: N802
135+
def visit_Call(self, node: Call) -> Optional[Union[AST, List[AST]]]:
136136
if isinstance(node.func, Name) and node.func.id == 'yield_from_it':
137137
if len(node.args) != 1 or node.keywords:
138138
raise WrongMarkerSyntaxError('The "yield_from_it" marker can be used with only one positional argument.')
@@ -168,7 +168,7 @@ def extract_context(self, context_name: str, addictional_transformers: Optional[
168168
check_decorators = self.check_decorators
169169

170170
class RewriteContexts(NodeTransformer):
171-
def visit_With(self, node: With) -> Optional[Union[AST, List[AST]]]: # noqa: N802
171+
def visit_With(self, node: With) -> Optional[Union[AST, List[AST]]]:
172172
if len(node.items) == 1:
173173
if isinstance(node.items[0].context_expr, Name):
174174
context_expr = node.items[0].context_expr
@@ -182,7 +182,7 @@ def visit_With(self, node: With) -> Optional[Union[AST, List[AST]]]: # noqa: N8
182182
return node
183183

184184
class DeleteDecorator(NodeTransformer):
185-
def visit_FunctionDef(self, node: FunctionDef) -> Optional[Union[AST, List[AST]]]: # noqa: N802
185+
def visit_FunctionDef(self, node: FunctionDef) -> Optional[Union[AST, List[AST]]]:
186186
if node.name == original_function.__name__:
187187
nonlocal transfunction_decorator
188188
transfunction_decorator = None

transfunctions/typing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# noqa: A005
21
import sys
32
from collections.abc import Iterable
43
from typing import TypeVar

0 commit comments

Comments
 (0)