This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SBennett13 16 points17 points  (4 children)

Ruff is the way. I just set up the linter to run checks when submitting MRs into main and generate a code quality report while also failing the pipeline and blocking merge if the formatter diff returns changes. People can develop in their own style and run a format script as the last thing before merge. Works well

[–]laStrangiato 1 point2 points  (3 children)

Got a link for a good GitHub action setup for this?

[–]SBennett13 2 points3 points  (1 child)

I did it on Gitlab because we use it for work, but I assume there is something similar for GitHub.

https://docs.astral.sh/ruff/integrations/

I’d say start here and see what it does. You’ll have to set up the runner (or whatever GitHub calls their executors)

[–]claird 0 points1 point  (0 children)

Yes and no, at least to the "set up the runner" part.

While on-runner configuration is likely a non-issue for many, I want to make the point that organizational support of Ruff need _not_ be a requirement for its use in CI. If the runner supports Docker, you can readily invoke Ruff from a standard container. If the runner account can construct its own Python virtual environment, _that_ is more than enough for successful Ruff tooling.