Skip to content

Change to default line width in ruff - #324

Merged
cbrnr merged 4 commits into
cbrnr:mainfrom
DimitriPapadopoulos:88
Aug 6, 2026
Merged

Change to default line width in ruff#324
cbrnr merged 4 commits into
cbrnr:mainfrom
DimitriPapadopoulos:88

Conversation

@DimitriPapadopoulos

Copy link
Copy Markdown
Contributor

Use the default width of 88 characters instead of 92.

Fixes #320.

@DimitriPapadopoulos
DimitriPapadopoulos force-pushed the 88 branch 2 times, most recently from 6c0eff6 to 68187ef Compare August 5, 2026 19:09
Use the default width of 88 characters instead of 92.
By default, ruff selects rules that are compatible with the use of
a formatter. It will ignore rules such as E501.
@cbrnr
cbrnr merged commit d18d20b into cbrnr:main Aug 6, 2026
8 checks passed
@cbrnr

cbrnr commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Thanks @DimitriPapadopoulos!

Comment thread pyproject.toml

[tool.ruff.lint]
extend-select = ["C4", "D", "FURB", "I", "PERF", "W", "UP"]
extend-select = ["C4", "D", "PERF", "W"]

@DimitriPapadopoulos DimitriPapadopoulos Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@cbrnr Not 100 % sure FURB, I or UP should be removed. From scientific-python/cookie#843:

Ruff 0.16 turns on 413 rules without configuration. Compared the default set against the full rule index: BLE, DTZ, FA, FLY, INT, PIE, and YTT are fully covered (including preview rules), and I is covered except for I002, which needs the lint.isort.required-imports setting. No other group is fully covered.
[...]

  • Removed the RF102 check ("isort must be selected"). RF101 (B) and RF103 (UP) stay, because those groups are not fully default.

But then the defaults may be good enough for us.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

OK, I thought these were included by default? https://docs.astral.sh/ruff/default-rules/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not all rules, but I guess the ruff authors made a sensible choice.

Nevertheless, I'd like to understand which rules in B and UP they left out, and why they left out I002 — it should be a no-op anyway without required-imports.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

OK, I think the defaults should be fine, but feel free to add specific rules that you think are important.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use 88 characters line width

2 participants