Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace black and pyproject.toml with ruff format and ruff.toml #1188

Merged
merged 11 commits into from
Jan 23, 2025
Merged

Conversation

quis
Copy link
Member

@quis quis commented Jan 22, 2025

This will let us use pyproject.toml for stuff that is specific to utils (like dependencies) and we can stop copying it into each app.

We can then delete the duplicate copy of pyproject.toml we had to create in #1187


ruff format is faster than black and means we need one fewer dependency.

While ruff aims for 99.9% compatibility with black our codebase is big enough to hit a couple of the differences, hence some slight changes to Python code, and the need to consider this a breaking change for consuming apps.

@quis quis changed the title Move ruff config into ruff.toml Replace black and pyproject.toml with ruff format and ruff.toml Jan 23, 2025
@@ -7,5 +7,4 @@ pytest-testmon==2.1.1
requests-mock==1.12.1
freezegun==1.5.1

black==24.10.0 # Also update `.pre-commit-config.yaml` if this changes
ruff==0.8.2 # Also update `.pre-commit-config.yaml` if this changes
Copy link
Contributor

Choose a reason for hiding this comment

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

while we're changing our formatter, is it worth updating to ruff 0.9.x? (which changes formatter rules slightly, including "Improved compatibility with Black’s style guide")

https://astral.sh/blog/ruff-v0.9.0

Copy link
Contributor

Choose a reason for hiding this comment

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

Preserving the source formatting for these cases means that the longstanding formatter incompatibility with our ISC001 rule is now resolved. Users will no longer see a warning if they have both the formatter and this lint rule enabled in their Ruff configuration.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, have made the bump in 122d4fd and rebased

quis added 7 commits January 23, 2025 11:29
This will let us use `pyproject.toml` for stuff that is specific to
utils (like dependencies) and we can stop copying it into each app.
This is where the apps should look for their linter config now.
This is no longer used anywhere
It’s faster and means we have one fewer dependencies.
@quis quis merged commit 43e20cd into main Jan 23, 2025
2 checks passed
@quis quis deleted the ruff-toml branch January 23, 2025 12:55
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