Skip to content

Add all default ruff lint rules which have auto fixes available - #5491

Open
DylanRussell wants to merge 8 commits into
open-telemetry:mainfrom
DylanRussell:upgrade_ruff2
Open

Add all default ruff lint rules which have auto fixes available#5491
DylanRussell wants to merge 8 commits into
open-telemetry:mainfrom
DylanRussell:upgrade_ruff2

Conversation

@DylanRussell

Copy link
Copy Markdown
Contributor

Description

Updated select = [...] in pyproject.toml
to include the 407 stable default rules from https://docs.astral.sh/ruff/default-rules/ (excluding 6 preview-only rules to avoid CLI warnings).

Updated ignore = [...] in pyproject.toml to include E501 alongside the 34 unfixable rule codes from the default ruleset.

I can try adding and fixing those in a separate CL.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Unit tests

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@DylanRussell
DylanRussell requested a review from a team as a code owner July 30, 2026 17:42

@emdneto emdneto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think would be better to Select the entire ruleset and ignore the ones which don't have auto-fix

Comment thread pyproject.toml
"G", # https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"TID", # https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
"YTT101", "YTT102", "YTT103", "YTT201", "YTT202", "YTT203", "YTT204", "YTT301",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need all of those rules?

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants