Skip to content

Use 'Ruff' for linting and formatting#2012

Merged
jensens merged 10 commits intocookiecutter:mainfrom
danieleades:ruff
Mar 15, 2024
Merged

Use 'Ruff' for linting and formatting#2012
jensens merged 10 commits intocookiecutter:mainfrom
danieleades:ruff

Conversation

@danieleades
Copy link
Copy Markdown
Contributor

@danieleades danieleades commented Feb 4, 2024

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.

@danieleades
Copy link
Copy Markdown
Contributor Author

@jensens anything i can do to move this along?

@jensens
Copy link
Copy Markdown
Contributor

jensens commented Mar 14, 2024

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 ?

@danieleades
Copy link
Copy Markdown
Contributor Author

danieleades commented Mar 15, 2024

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 ?

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 pyproject.toml

@jensens jensens added the code style This issue/PR relates to the project code style modification label Mar 15, 2024
@jensens jensens merged commit f256573 into cookiecutter:main Mar 15, 2024
@jensens
Copy link
Copy Markdown
Contributor

jensens commented Mar 15, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code style This issue/PR relates to the project code style modification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants