Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.14
rev: v0.15.0
hooks:
- id: ruff-check
args: [--fix]
Expand Down
2 changes: 1 addition & 1 deletion flake8_async/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# several different ones are used for the same code. Used in e.g. Visitor103
def strip_error_subidentifier(s: str) -> str:
"""Turn e.g. ASYNC103_anyio_trio => ASYNC103."""
return s.split("_")[0]
return s.split("_", maxsplit=1)[0]


def error_has_subidentifier(s: str) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions flake8_async/visitors/flake8asyncvisitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def walk(self, *body: ast.AST) -> Iterable[ast.AST]:

@property
def library(self) -> tuple[str, ...]:
return self.__state.library if self.__state.library else ("trio",)
return self.__state.library or ("trio",)

@property
def library_str(self) -> str:
Expand Down Expand Up @@ -253,7 +253,7 @@ def should_autofix(self, node: cst.CSTNode, code: str | None = None) -> bool:

@property
def library(self) -> tuple[str, ...]:
return self.__state.library if self.__state.library else ("trio",)
return self.__state.library or ("trio",)

# library_str not used in cst yet

Expand Down
2 changes: 1 addition & 1 deletion flake8_async/visitors/visitor91x.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def __init__(

@property
def library(self) -> tuple[str, ...]:
return self.__library if self.__library else ("trio",)
return self.__library or ("trio",)

def should_autofix(self, node: cst.CSTNode, code: str | None = None) -> bool:
return not self.noautofix
Expand Down
2 changes: 1 addition & 1 deletion tests/test_flake8_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def _parse_eval_file(
) -> tuple[list[Error], list[str], str]:
# version check
check_version(test)
test = test.split("_")[0]
test = test.split("_", maxsplit=1)[0]

parsed_args = []

Expand Down
Loading