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

CI: add ruff linter / formattter / import sorter and codespell jobs #8

Merged
merged 11 commits into from
Mar 20, 2024

Conversation

hnez
Copy link
Member

@hnez hnez commented Mar 18, 2024

This PR is based on #6 and intended to replace it.

This changes the recommended auto formatter from black to ruff. The main benefit of this change is that ruff also includes a linter and an import sorter, that do not need configuration to work together without fighting.

The linter and import sorting features of ruff are then used to and added to the CI to make sure that best practices are followed in all pull requests.

Lastly this also adds a CI job that runs codespell to fix new typos from entering the codebase.

Copy link
Member

@SmithChart SmithChart left a comment

Choose a reason for hiding this comment

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

Minor changes requested.
Otherwise LGTM!

And I like that we use our make qa -targets in Github CI instead of some 3rd-party integrations :-D

.codespellrc Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
SmithChart and others added 6 commits March 19, 2024 16:11
These settings configure the ruff auto formatter and linter.

Signed-off-by: Leonard Göhrs <[email protected]>
Signed-off-by: Chris Fiege <[email protected]>
With this change a simple `make qa` will run `ruff format` and
`ruff check` as if it would be running in CI.

Signed-off-by: Leonard Göhrs <[email protected]>
Signed-off-by: Chris Fiege <[email protected]>
The black and ruff auto formatters mostly agree about how python code
should be formatted, but there are some subtle differences.
Re-format using ruff.

Signed-off-by: Leonard Göhrs <[email protected]>
The main benefit of ruff is that it includes a formatter, import sorter
and linter all in one _and without them fighting about what is correct_.

Signed-off-by: Leonard Göhrs <[email protected]>
Signed-off-by: Leonard Göhrs <[email protected]>
Signed-off-by: Chris Fiege <[email protected]>
hnez and others added 3 commits March 19, 2024 16:13
Signed-off-by: Leonard Göhrs <[email protected]>
Signed-off-by: Chris Fiege <[email protected]>
@SmithChart SmithChart merged commit 3dfab51 into linux-automation:master Mar 20, 2024
2 checks passed
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