Skip to content

MNT: upgrading ruff to 0.16.x #20113

Closed

Description

@neutrinoceros

A new ruff minor appears

Blog post: https://astral.sh/blog/ruff-v0.16.0

This one is special (to me): of the 316 rule violations we get by upgrading now, 305 are for too-many-positional-arguments, a "rule" I've been informally discussing and advising in reviews for years throughout many projects. Crucially, this rule cannot be blinding applied to existing public APIs (without breaking them), and doesn't have as much value for private APIs, but it is extremely precious for new code, so my suggestion is to add local noqa comments (trivially done with ruff itself, e.g. uvx [email protected] check astropy --select PLR0917 --add-noqa) rather than disabling the rule globally.
Other violations should be trivally fixable. I'll keep track of them here.

RUF068

ISC004

FURB192

RUF036

Activity

  1. pllim commented on Jul 24, 2026

    @pllim
    Member

    OK all the linked PRs are merged. Thanks for being on top of this.

    So now we just wait for the auto update? Can we close this issue?

  2. neutrinoceros commented on Jul 24, 2026

    @neutrinoceros
    ContributorAuthor

    Not yet, we'll need to address/ignore violations to PLR0917 too, and I expect that'll be easier to do along with the upgrade.

  3. pllim commented on Jul 24, 2026

    @pllim
    Member

    As for https://docs.astral.sh/ruff/rules/too-many-positional-arguments/ (PLR0917), I think we should ignore it. Being nitpicky on style is one thing, but it is not ruff's place to tell me how many arguments I can have in my functions.

  4. neutrinoceros commented on Jul 24, 2026

    @neutrinoceros
    ContributorAuthor

    You can have as many arguments as you want as long as they're keyword-only, which I've been advocating for for years because it's extremely useful for long term maintenance.

  5. pllim commented on Jul 24, 2026

    @pllim
    Member

    This is an "old" repo (by software standards). I don't think we should be going around breaking API just because ruff is annoyed. If you want to enable for new code, that is negotiable, but we should ignore for existing code.

  6. neutrinoceros commented on Jul 24, 2026

    @neutrinoceros
    ContributorAuthor

    That's what I proposed in my description

  7. neutrinoceros commented on Oct 9, 2026

    @neutrinoceros
    ContributorAuthor

    well this is a new one: ruff 0.17.0 is out and we're still on 0.15.0
    Hopefully #20519 can save us from a world of pain

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions