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

Swap python linter and formatter to ruff #231

Merged
merged 8 commits into from
May 29, 2024
Merged

Swap python linter and formatter to ruff #231

merged 8 commits into from
May 29, 2024

Conversation

janbridley
Copy link
Contributor

@janbridley janbridley commented May 28, 2024

Description

Flake8 and yapf have been replaced with a minimal ruff config. Autofixes have been applied, and manual fixes have been implemented where necessary. pre-commit has been updated to use ruff.

Motivation and context

In addition to the increased performance, using ruff brings fresnel's python tooling up to spec with most other glotzerlab packages. Note that the config options selected here match the previous flake8 selections, with the exception of the RST rules which are not supported. Additional (more opinionated) options can be added in a future PR.

Change log

Switched python linter and formatter to Ruff

Checklist:

Copy link
Member

@joaander joaander left a comment

Choose a reason for hiding this comment

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

Thanks, this is great!

Let's embrace the black-like default config and set the line length to 88. With the popularity of black, most users likely have python rulers set to 88 these days.

We should also update style.rst to reference ruff instead of yapf and remove references to the yapf plugins.

ruff.toml Outdated Show resolved Hide resolved
@janbridley
Copy link
Contributor Author

Thanks, this is great!

Let's embrace the black-like default config and set the line length to 88. With the popularity of black, most users likely have python rulers set to 88 these days.

We should also update style.rst to reference ruff instead of yapf and remove references to the yapf plugins.

Done - everything should be sorted now!

@joaander joaander marked this pull request as ready for review May 29, 2024 13:52
@joaander joaander requested review from a team and joaander and removed request for a team May 29, 2024 13:52
Copy link
Member

@joaander joaander left a comment

Choose a reason for hiding this comment

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

Thanks!

@joaander joaander merged commit 7eac406 into trunk May 29, 2024
33 checks passed
@joaander joaander deleted the admin/ruff branch May 29, 2024 15:17
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