Skip to content

Set ruff line-length to 120 and enforce E501#4742

Open
Kludex wants to merge 2 commits into
open-telemetry:mainfrom
Kludex:set-line-length-120
Open

Set ruff line-length to 120 and enforce E501#4742
Kludex wants to merge 2 commits into
open-telemetry:mainfrom
Kludex:set-line-length-120

Conversation

@Kludex

@Kludex Kludex commented Jun 25, 2026

Copy link
Copy Markdown
Member

Description

Bump the ruff line-length from 79 to 120 and remove E501 from the ignore list so long lines are now linted.

  • ruff format reflows code under the new width (the bulk of the diff).
  • String literals, docstrings, and test fixtures the formatter cannot wrap were rewrapped by hand (implicit string concatenation, parenthesized continuations, docstring reflow). No # noqa added.
  • Lines that remain over 120 are single unsplittable tokens (URLs, # pylint:/# pyright: pragmas); ruff's E501 exempts these, and the lint gate is green.

Type of change

  • This change requires a documentation update — N/A (no behavior change; tooling/style only)

How Has This Been Tested?

  • uv run pre-commit run ruff --all-files passes (0 E501).
  • All changed .py files byte-compile.
  • Rewrapped string/fixture values verified byte-identical to before via AST comparison.
  • Ran affected suites: resource-detector-azure, dbapi, wsgi - all pass.

Does This PR Require a Core Repo Change?

  • No.

Checklist:

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

AI Disclaimer

This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.

Bump the project line-length from 79 to 120 and remove E501 from the ruff
ignore list so long lines are now linted. Reformat the repo with ruff to
reflow code under the new width, and manually rewrap the string literals,
docstrings, and test fixtures that the formatter cannot wrap.

Assisted-by: Claude Opus 4.8
@Kludex Kludex requested a review from a team as a code owner June 25, 2026 19:58
@github-actions github-actions Bot added the gen-ai Related to generative AI label Jun 25, 2026
@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Jun 25, 2026
- Regenerate bootstrap_gen.py so it matches the 120-char format
- Realign the mysql and psycopg2 docstring grid tables broken during rewrapping
- Restore the anthropic cast() target to a single string literal so pyright
  parses it as a type
- Add the changelog fragment

Assisted-by: Claude Opus 4.8
@Kludex

Kludex commented Jun 26, 2026

Copy link
Copy Markdown
Member Author

@xrmx wanna do the honors before a PR gets in and I have to rebase? 😢

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

Labels

gen-ai Related to generative AI

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

5 participants