diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml new file mode 100644 index 0000000..a6668e4 --- /dev/null +++ b/.github/workflows/ruff.yml @@ -0,0 +1,32 @@ +name: Ruff + +on: + push: + branches: ["master"] + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + lint: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install Ruff + run: pip install ruff + + - name: Format code + run: ruff --config pyproject.toml format . + + - name: Fix lint issues + run: ruff --config pyproject.toml check --fix --exit-zero . + + - name: Ensure no remaining lint issues + run: ruff --config pyproject.toml check .