Use 'Ruff' for linting and formatting#2012
Merged
jensens merged 10 commits intocookiecutter:mainfrom Mar 15, 2024
Merged
Conversation
This was referenced Feb 4, 2024
Merged
Merged
Merged
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Contributor
Author
|
@jensens anything i can do to move this along? |
Contributor
|
Looks overall good to me, just one thing, maybe personal flavor of mine: Why a ruff.toml if the very same configuration could be placed in pyproject.toml ? |
Contributor
Author
I'll shift it over. Originally I was trying to minimise the impact on the original config, but then found it made it fully redundant Edit: @jensens this is now moved into |
jensens
approved these changes
Mar 15, 2024
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a minimal Ruff configuration. I've chosen this configuration to match as closely as possible the behaviour of the existing linting and formatting, and have the least possible impact on existing code.
Ruff is a couple of orders of magnitude faster than flake8, which is particularly handy when using it as a pre-commit hook. It also has a massive range of additional lints that can be applied, and is able to autofix a large proportion of them.
If adding additional linting or more aggressive formatting is desirable that can be added (and discussed) in separate PRs. I've left the other lint groups in the config file, commented out. Suggest that these can be switched on one by one in other PRs (or removed) as appropriate.