Ruff CI/CD job
Objective
Run Ruff, an extremely fast Python linter, on your Python code.
How to use it
- Configure ruff for your project
- Include the ruff component in your CI/CD pipeline (GitLab/GitHub compatible)
GitLab
Add the following to your .gitlab-ci.yml
file:
include:
- component: $CI_SERVER_FQDN/swepy/cicd-templates/ruff/ruff@4.0.0
See more for GitLab here: docs/gitlab.md.
GitHub
Add the following jobs to your .github/workflows
lint file:
jobs:
ruff_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: ruff check
uses: astral-sh/ruff-action@v1
ruff_format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: ruff format
uses: astral-sh/ruff-action@v1
with:
args: "format --check"
See more for GitHub here: github/marketplace/ruff-action.
badge to your project README.md
Add an official To display the use of Ruff in your project, you can add the following badge to your README.md:
[](https://github.com/astral-sh/ruff)
A more "classic" version of the
badge ()
is also available:
[](https://github.com/astral-sh/ruff)