From e28d248cf94a81cf17465b00a38334e6581bd3f5 Mon Sep 17 00:00:00 2001 From: Joel Krauska Date: Fri, 3 Oct 2025 20:55:11 -0700 Subject: [PATCH] Automate ruff in github action --- .github/workflows/lint.yml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..13c8491 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,39 @@ +name: Ruff + +on: + pull_request: + paths: + - "**/*.py" + - "pyproject.toml" + - "ruff.toml" + - ".pre-commit-config.yaml" + +jobs: + ruff: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - name: Cache Ruff + uses: actions/cache@v4 + with: + path: ~/.cache/ruff + key: ruff-${{ runner.os }}-${{ hashFiles('**/pyproject.toml', '**/ruff.toml') }} + + - name: Install Ruff + run: pip install "ruff==0.6.9" + + # Lint (with GitHub annotation format for inline PR messages) + - name: Ruff check + run: ruff check --output-format=github . + + # Fail PR if formatting is needed + - name: Ruff format (check-only) + run: ruff format --check . + + # TODO: Investigate only applying to changed files and possibly apply fixes \ No newline at end of file