Skip to content

Enforce a few more ruff rules#12157

Merged
jacobtomlinson merged 5 commits intodask:mainfrom
DimitriPapadopoulos:ISC
Nov 20, 2025
Merged

Enforce a few more ruff rules#12157
jacobtomlinson merged 5 commits intodask:mainfrom
DimitriPapadopoulos:ISC

Conversation

@DimitriPapadopoulos
Copy link
Copy Markdown
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented Nov 14, 2025

See comments in individual commits. Enabling these rules does't raise any issue. This is a kind of proof that they apply well to this project 😄

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 14, 2025

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

      9 files  ±0        9 suites  ±0   3h 11m 18s ⏱️ -42s
 18 154 tests ±0   16 939 ✅ ±0   1 215 💤 ±0  0 ❌ ±0 
162 614 runs  ±0  150 520 ✅ ±0  12 094 💤 ±0  0 ❌ ±0 

Results for commit 34b43a2. ± Comparison against base commit e867681.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

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

I think I'm -1 on merging this. It's clear that we aren't running into any of these problems because there are no fixes needed. I expect because they aren't relevant or are being handled by other tools/linters/rules.

Adding more rules for the sake of it just makes things more likely to run into rule conflict in the future. We should only add things if they add value.

"B",
"T10",
"TID",
"ISC",
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 expect black is fixing these for us already.

Copy link
Copy Markdown
Contributor Author

@DimitriPapadopoulos DimitriPapadopoulos Nov 17, 2025

Choose a reason for hiding this comment

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

Older versions of black would actually create these when joining split lines. But yes, recent versions do seem to join split lines correctly.

However, I am not certain black fixes occurrences from older versions, or manually created occurrences, which is why I tend to add these rules. Ruff itself is unable to autofix some occurrences, I guess it's not an easy task.

This is (or at least used to be) useful to catch cases where black would
reformat:
	"line1"
	"line2"
as:
	"line1" "line2"
instead of:
	"line1line2"
This should be a replaceemnt for this discarded isort option:
	add_imports = ["from __future__ import annotations"]

See 1ab0d43.
I believe the maintainers do have an interest in rule TID252, since
ruff doesn't raise a single issue in this project:
	Absolute imports, or relative imports from siblings,
	are recommended by PEP 8 [...]
Order rules according to the ruff documentation:
https://docs.astral.sh/ruff/rules/
@jacobtomlinson jacobtomlinson merged commit e6ea356 into dask:main Nov 20, 2025
23 of 25 checks passed
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.

2 participants