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

GitHub Action to lint Python code #128

Closed
wants to merge 4 commits into from
Closed

Conversation

cclauss
Copy link

@cclauss cclauss commented Mar 13, 2023

Ruff supports over 500 lint rules and can be used to replace Flake8 (plus dozens of plugins), isort, pydocstyle, yesqa, eradicate, pyupgrade, and autoflake, all while executing (in Rust) tens or hundreds of times faster than any individual tool.

The ruff Action uses minimal steps to run in ~10 seconds, rapidly providing intuitive GitHub Annotations to contributors.

image

Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

I'm not sure if we really want ruff in GHA. All the linters are consolidated in pre-commit so that'd be the correct place to put the invocation in — it allows running the same checks locally as in pre-commit.ci.

But if I were to accept the GHA implementation (maybe, additionally, even through a pre-commit run that invokes just one check), here are some concerns:

  • I don't think it's needed to apply event trigger branch filters.
  • I know that some people don't like annotations. I used to integrate them a lot and got feedback that they may clutter the diff view, especially since they don't clear out on new PR commits. I don't have a strong opinion on this, but it is something to consider. Reporting to Job Summaries might be less distracting.
  • I'd want the linting job to run in the same workflow as smoke-testing and have a https://github.com/marketplace/actions/alls-green job integrated for the consolidated check.
  • Our target version is Python 3.11 — this is what the container runtime uses.

@cclauss cclauss closed this Sep 21, 2023
@cclauss cclauss deleted the patch-1 branch September 21, 2023 13:48
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

2 participants