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

Drop ruff from GitHub Actions as it is covered by pre-commit.ci #21

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

zerolab
Copy link
Contributor

@zerolab zerolab commented Dec 20, 2023

IMHO there is no need to do additional processing if you don't have to

Copy link
Owner

@marksweb marksweb left a comment

Choose a reason for hiding this comment

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

Yeah, that's a fair point. I think I get into the habbit of both, because not all repos are public and get the pre-commit bot.

@marksweb marksweb merged commit 501bd9e into marksweb:main Dec 20, 2023
5 checks passed
@zerolab zerolab deleted the chore/drop-ruff-from-gha branch December 20, 2023 16:24
@cclauss
Copy link
Contributor

cclauss commented Jan 4, 2024

The dual processing is a red herring given that ruff (in rust) can lint the entire CPython codebase in a small fraction of a second. The setup/teardown dwarfs the ruff runtime. It is useful to add GitHub Annotation to the pull request via the option ruff --output-format=github in the GHA yaml while that setting would be misplaced in pre-commit.

@zerolab
Copy link
Contributor Author

zerolab commented Jan 4, 2024

@cclauss Do you have an example of ruff --output-format=github in action?

@cclauss
Copy link
Contributor

cclauss commented Jan 4, 2024

ruff --output-format=github gives us GitHub Actions annotations:
Ruff annotations

@zerolab
Copy link
Contributor Author

zerolab commented Jan 4, 2024

TIL! This does look rather usefil. I had a check and the whole action takes about 5s. It all adds up in the end, but... @marksweb would you like a PR re-adding the action with --output-format=github?

@cclauss
Copy link
Contributor

cclauss commented Jan 4, 2024

One performance hint is that you can skip the setup-python step in that GitHub Action because while ruff is installed via pip it is Rust code, not Python code so GHA's built-in Python is more than adequate.

@marksweb
Copy link
Owner

marksweb commented Jan 4, 2024

This is indeed useful and interesting @zerolab. I think it's worth having a dedicated ruff workflow setup like that.

Thanks @cclauss!

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.

None yet

3 participants