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

Use ruff format instead of black #427

Merged
merged 6 commits into from
May 13, 2024

Conversation

jherland
Copy link
Member

Ruff comes with a built-in formatter (ruff format) which serves as a drop-in replacement for black. The difference in the formatting are minuscule, and can be seen in the second commit in this PR.

Also remove isort as a formatting dependency, since ruff check already performs the same checks.

Commits:

  • Use ruff's default line-length
  • Formatting changes introduced by ruff format .
  • noxfile.py: Run ruff format instead of black
  • Remove black as a dependency
  • Remove isort as a formatting dependency
  • Update docs to mention ruff instead of black + isort

@jherland jherland self-assigned this Apr 17, 2024
@jherland jherland requested review from mknorps and zz1874 April 17, 2024 08:02
@jherland jherland force-pushed the jherland/remove-pylint branch 2 times, most recently from 59de27c to 251cfba Compare May 6, 2024 12:49
@jherland jherland force-pushed the jherland/ruff-format-instead-of-black branch from f409601 to a2c964c Compare May 6, 2024 12:50
Copy link
Collaborator

@mknorps mknorps left a comment

Choose a reason for hiding this comment

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

Tested and approved 🚀

image
⬆️ always a happy sight :)

Base automatically changed from jherland/remove-pylint to main May 13, 2024 11:04
We have already disabled the line-length warning from `ruff check`,
so this directive already have no effect.

We're about to replace `black` with `ruff format`, and in order for the
latter to behave as similarly to the former as possible, we want to
configure both with the same line-length. Both tools default to line-
length = 88, so that is what we want to use as well. Simply remove the
directive to achieve this.
The checks/formatting being done by isort is already covered by
`ruff check .`, so there is no need to run isort separately in our
formatting sessions.

Note that isort itself remains a main/direct dependency of FawltyDeps
itself. This commit only concerns its use as a formatting tool.
@jherland jherland force-pushed the jherland/ruff-format-instead-of-black branch from a2c964c to fc666fd Compare May 13, 2024 11:16
@jherland jherland merged commit ee03de4 into main May 13, 2024
63 checks passed
@jherland jherland deleted the jherland/ruff-format-instead-of-black branch May 13, 2024 11:59
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.

None yet

2 participants