Skip to content

Commit

Permalink
need to use force-exclude for black+pre-commit. Exclude autofix_files…
Browse files Browse the repository at this point in the history
… with isort
  • Loading branch information
jakkdl committed May 24, 2024
1 parent f352f92 commit 016a44d
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog

*[CalVer, YY.month.patch](https://calver.org/)*

24.5.3
24.5.4
======
- Add ASYNC913: Indefinite loop with no guaranteed checkpoint.
- Fix bugs in ASYNC910 and ASYNC911 autofixing where they sometimes didn't add a library import.
Expand Down
2 changes: 1 addition & 1 deletion flake8_async/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@


# CalVer: YY.month.patch, e.g. first release of July 2022 == "22.7.1"
__version__ = "24.5.3"
__version__ = "24.5.4"


# taken from https://github.com/Zac-HD/shed
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ remove-duplicate-keys = true
remove-unused-variables = true

[tool.black]
extend-exclude = "tests/autofix_files/.*.py"
# need to use force-exclude since pre-commit directly specifies files
force-exclude = "tests/autofix_files/.*.py"

[tool.codespell]
ignore-words-list = 'spawnve'
Expand All @@ -19,7 +20,7 @@ profile = "black"
py_version = "311"
quiet = true
skip_gitignore = true
skip_glob = "tests/eval_files/*"
skip_glob = "tests/*_files/*"

[tool.mypy]
check_untyped_defs = true
Expand Down
2 changes: 0 additions & 2 deletions tests/autofix_files/async910_insert_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@


import trio


def condition() -> bool:
return False

Expand Down
2 changes: 0 additions & 2 deletions tests/autofix_files/async911_insert_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@


import trio


def condition() -> bool:
return False

Expand Down
4 changes: 4 additions & 0 deletions tests/autofix_files/async913.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ async def foo_conditional_nested():
...


# various checks I added for my own sanity to ensure autofixes worked when multiple
# codes simultaneously want to autofix.


async def foo_indef_and_910():
while True: # ASYNC913: 4
await trio.lowlevel.checkpoint()
Expand Down
4 changes: 3 additions & 1 deletion tests/autofix_files/async913.py.diff
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
if condition():
await foo()

@@ x,24 x,29 @@
@@ x,19 x,23 @@
while True:
if condition():
break
Expand All @@ -47,6 +47,8 @@
...


@@ x,6 x,7 @@

async def foo_indef_and_910():
while True: # ASYNC913: 4
+ await trio.lowlevel.checkpoint()
Expand Down

0 comments on commit 016a44d

Please sign in to comment.