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 flake8 and black with ruff #118

Merged
merged 9 commits into from
Dec 2, 2023
Merged

Replace flake8 and black with ruff #118

merged 9 commits into from
Dec 2, 2023

Conversation

berendkleinhaneveld
Copy link
Collaborator

Just noticed that ruff has a 0.1.* version out that includes a formatter that serves as a drop-in replacement for black.
Thought I'd try to apply it to this repo, see what it would entail to adopt it.

One thing I noticed is that the linter will not complain if something is wrong that could be solved by running the formatter, so in the pre-commit config and in the linting step in CI, I've added a step to check the formatting specifically.

pyproject.toml Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
@berendkleinhaneveld
Copy link
Collaborator Author

I got one more thing: I also wanted to checkout the default setting for import sorting, so I added a commit that does just that. I'm not sure I like the order much better, but on the other hand: as long as I don't have to order the imports by hand, I'm happy. What do you think?

And I also applied --fix on the linting step in pre-commit, so it mirrors the behaviour of the format step.

@Korijn
Copy link
Collaborator

Korijn commented Dec 2, 2023

I got one more thing: I also wanted to checkout the default setting for import sorting, so I added a commit that does just that. I'm not sure I like the order much better, but on the other hand: as long as I don't have to order the imports by hand, I'm happy. What do you think?

And I also applied --fix on the linting step in pre-commit, so it mirrors the behaviour of the format step.

The imports are still in three groups right? That's really what's most important to me. I want to be able to quickly see what standard library and third party dependencies are used. I don't care about the order within the groups.

Seems fine with me.

@berendkleinhaneveld berendkleinhaneveld marked this pull request as ready for review December 2, 2023 22:18
@Korijn Korijn merged commit 3fcc63c into master Dec 2, 2023
7 checks passed
@Korijn Korijn deleted the ruff branch December 2, 2023 23:38
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