-
Notifications
You must be signed in to change notification settings - Fork 2
ci: add lint workflow using ruff #13
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,39 @@ | ||||||
| name: CI - Lint | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: [main] | ||||||
| pull_request: | ||||||
| branches: [main] | ||||||
|
|
||||||
| concurrency: | ||||||
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||||||
| cancel-in-progress: true | ||||||
|
|
||||||
| env: | ||||||
| PYTHONUNBUFFERED: "1" | ||||||
| FORCE_COLOR: "1" | ||||||
|
|
||||||
| jobs: | ||||||
| lint: | ||||||
| name: Lint Code | ||||||
| runs-on: ubuntu-latest | ||||||
|
|
||||||
| steps: | ||||||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||||||
|
|
||||||
| - name: Set up Python | ||||||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 | ||||||
| with: | ||||||
| python-version: '3.12' | ||||||
|
|
||||||
| - name: Install Ruff | ||||||
| run: | | ||||||
| python -m pip install --upgrade pip | ||||||
| pip install ruff==0.12.8 | ||||||
|
|
||||||
| - name: Run linting | ||||||
| run: ruff check . | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 major (bug):
Suggested change
|
||||||
|
|
||||||
| - name: Check formatting | ||||||
| run: ruff format --check . | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 major (design): Ruff version drift across the repo will cause CI to disagree with local tooling. This workflow installs
ruff==0.12.8, but.pre-commit-config.yamlpinsruff-pre-commitatv0.9.7andpyproject.tomldev deps pinruff = "^0.12.3". Becauseruff formatoutput and lint rule sets change between versions, a contributor who runs pre-commit (0.9.7) can produce code that failsruff format --check/ruff checkunder 0.12.8 in CI even though they followed the project's hooks. Pin CI to the same ruff version the project uses (and ideally bump the pre-commit hook to match) so local and CI results are consistent.