Skip to content

Commit 9b3e99f

Browse files
[pre-commit.ci] pre-commit autoupdate (#428)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.14.14 → v0.15.0](astral-sh/ruff-pre-commit@v0.14.14...v0.15.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e7473f1 commit 9b3e99f

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ci:
99

1010
repos:
1111
- repo: https://github.com/astral-sh/ruff-pre-commit
12-
rev: v0.14.14
12+
rev: v0.15.0
1313
hooks:
1414
- id: ruff-check
1515
args: [--fix]

flake8_async/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# several different ones are used for the same code. Used in e.g. Visitor103
1414
def strip_error_subidentifier(s: str) -> str:
1515
"""Turn e.g. ASYNC103_anyio_trio => ASYNC103."""
16-
return s.split("_")[0]
16+
return s.split("_", maxsplit=1)[0]
1717

1818

1919
def error_has_subidentifier(s: str) -> bool:

flake8_async/visitors/flake8asyncvisitor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def walk(self, *body: ast.AST) -> Iterable[ast.AST]:
144144

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

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

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

258258
# library_str not used in cst yet
259259

flake8_async/visitors/visitor91x.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def __init__(
344344

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

349349
def should_autofix(self, node: cst.CSTNode, code: str | None = None) -> bool:
350350
return not self.noautofix

tests/test_flake8_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def _parse_eval_file(
395395
) -> tuple[list[Error], list[str], str]:
396396
# version check
397397
check_version(test)
398-
test = test.split("_")[0]
398+
test = test.split("_", maxsplit=1)[0]
399399

400400
parsed_args = []
401401

0 commit comments

Comments
 (0)