Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Come up with human-friendly names for all error codes, and support those in --disable etc #236

Open
jakkdl opened this issue Apr 16, 2024 · 1 comment

Comments

@jakkdl
Copy link
Member

jakkdl commented Apr 16, 2024

Ruff might be adding support for human-friendly names for rules astral-sh/ruff#1773

So at some point somebody probably needs to come up with names for our rules as they're implemented in Ruff anyway, in which case we might as well do it ourselves*. The easiest place to support this would be in --disable and --enable. We don't currently parse # noqa, see #185, but this adds another reason to handle noqa-parsing on our own.
But the main upside is probably in daily speech and discussion, throwing around ASYNC102 or ASYNC119 ~always requires looking up the codes even for me.

* Claude did decent but not great when asked for suggestions:

ASYNC100:
- timeout-no-await
- idle-timeout
- checkpoint-missing
- await-required

ASYNC101:
- unsafe-nursery-yield
- yield-breaks-nursery
- yield-context-only
- invalid-yield

ASYNC102:
- unshielded-await
- await-needs-shield
- unsafe-finally-await
- unprotected-await

ASYNC103:
- unhandled-cancellation
- cancellation-not-reraised
- missing-cancel-handler
- reraise-required

ASYNC104:
- unreraised-cancellation
- must-reraise-cancel
- cancellation-not-propagated
- incomplete-cancellation
@jakkdl
Copy link
Member Author

jakkdl commented May 24, 2024

  • Come up with names and add to documentation Rules documentation improvements #248
  • Support in --enable and --disable
  • Support in noqa.
    * This would depend on full # noqa support #185, as we currently fully rely on flake8 for noqa suppression.
    * It would also introduce additional incompatibility with flake8-noqa, as they would flag invalid-looking noqa comments. (unless we suggest upstream to update their regex.. which might not be impossible with ruff considering human-friendly). Add support for external codes plinss/flake8-noqa#30 might resolve this, perhaps with a followup to enable non-code-looking rules, but it's been open for 6 months with no response from repo owner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant