Skip to content

Lint red since ruff 0.17.3 (#218): pin target-version and rule selection #225

Open

Description

@ErikBjare

Problem

The lint job has been red on master since #218 bumped jpetrucciani/ruff-check to the ruff 0.17.3 pin. Ruff 0.17 enables many more rules by default. The same tree passes with ruff 0.15.22 and fails with 0.17.3:

  • 153 findings with the defaults; 117 with --target-version py38, of which 62 are FA100. The rest are a long tail (UP032, I001, PLW1510, TRY*, SIM*, B008/B017/B018, PERF102, LOG009, RUF100, …), mostly in tests/.
  • Some of the auto-fixes would break the declared python = "^3.8" support: UP017 rewrites to datetime.UTC, which needs Python 3.11. That happens because [tool.ruff] sets no target-version.

Fix

  1. In [tool.ruff], set target-version = "py38" (or whatever the minimum Python actually is) and an explicit select that matches the rule set lint enforced before build(deps): bump jpetrucciani/ruff-check from 0.15.22 to 0.17.3 #218, so future ruff bumps can't silently widen it.
  2. Then either fix what's left, or adopt new rule families deliberately in separate commits. Don't mass-apply --fix --unsafe-fixes.
  3. Confirm with uvx ruff@0.17.3 check . locally before pushing.

This only affects lint and doesn't block releases (v0.14.2 shipped with it red), but it hides real lint regressions while it stays red.

@TimeToBuildBob

Activity

  1. TimeToBuildBob commented on Nov 10, 2026

    @TimeToBuildBob
    Contributor

    Step 1 is mostly done in #224, which has been open since 2026-11-06. CI is green and Greptile scored it 5/5. It moves the config to [tool.ruff.lint] and pins select = ["E4", "E7", "E9", "F"]. That is the pre-0.17 default and matches the old effective set of 58 rules exactly, with nothing added or dropped. With it, ruff 0.15.22 and 0.17.3 both pass ruff check ..

    It doesn't set target-version yet. I'm adding target-version = "py38" to that PR now and will re-run uvx ruff@0.17.3 check . before pushing. Adopting new rule families (FA100, UP, I001, etc.) belongs in separate follow-up commits, not this PR. No --unsafe-fixes.

  2. TimeToBuildBob commented on Nov 10, 2026

    @TimeToBuildBob
    Contributor

    Done in #224 (9d7d078): target-version = "py38" under [tool.ruff], plus the explicit select under [tool.ruff.lint].

    • uvx ruff@0.17.3 check . and uvx ruff@0.15.22 check . both pass. Both versions enable the same 58 rules, and the target resolves to 3.8.
    • On the new head, lint and format are green and the tests are running. The PR is config-only and ready for a merge click.

    New rule families (FA100 / UP / I001 / TRY / SIM …) are left for separate deliberate PRs.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions