Skip to content

Run ASYNC123 from flake8-async in pre-commit - #3587

Closed
jeeeeetshahhhhh wants to merge 1 commit into
python-trio:mainfrom
jeeeeetshahhhhh:add-flake8-async-precommit
Closed

jeeeeetshahhhhh wants to merge 1 commit into
python-trio:mainfrom
jeeeeetshahhhhh:add-flake8-async-precommit

Conversation

@jeeeeetshahhhhh

Copy link
Copy Markdown

Closes #3396.

Ruff already checks the ASYNC rules it supports. This adds flake8-async to pre-commit for ASYNC123, which is not implemented in Ruff and catches lost exception context when unwrapping single-exception groups. Scope the hook to Trio source files and exclude test fixtures, where the behavior is intentionally exercised.

Validation: pre-commit run flake8-async --all-files passed.

@A5rocks

A5rocks commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Let's not pick and choose flake8-async things to use.

@A5rocks A5rocks closed this Nov 11, 2026
@CoolCat467 CoolCat467 added the LLM Slop Entirely generated by a large language model with little or no human oversight label Nov 12, 2026
@jeeeeetshahhhhh

Copy link
Copy Markdown
Author

Let's not pick and choose flake8-async things to use.

I tried working on this by adding flake8-async to pre-commit, but I see the concern about only enabling ASYNC123.

Would the preferred approach be to enable the full set of flake8-async checks for the Trio source, rather than selecting individual rules? If so, I'd be happy to take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM Slop Entirely generated by a large language model with little or no human oversight

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run flake8-async in precommit

3 participants