Repository navigation
Enforce Ruff lint and formatting in CI and pre-commit #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint | |
| env: | |
| PYTHON_VERSION: "3.12" | |
| # Report on every PR, including changes outside the Python test paths. | |
| # Required checks need a result even when a PR changes no Python files. | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: lint-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ruff: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 1 | |
| persist-credentials: false | |
| - name: 🐍 setup python | |
| uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: 🛠️ install deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install uv | |
| uv sync --locked --extra dev | |
| - name: 🧹 ruff check | |
| run: uv run --locked --extra dev ruff check | |
| - name: 🎨 ruff format | |
| run: uv run --locked --extra dev ruff format --check |