Skip to content

support human-friendly names in --disable, noqa and --enable #236

Open

Description

@jakkdl

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

Activity

  1. jakkdl commented on May 24, 2024

    @jakkdl
    MemberAuthor
    • 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.
  2. added
    featureuser-facing improvement not directly related to a rule
    on Mar 5, 2025
  3. changed the title [-]Come up with human-friendly names for all error codes, and support those in `--disable` etc[/-] [+]support human-friendly names in `--disable`, `noqa` and `--enable`[/+] on Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureuser-facing improvement not directly related to a rule

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions