Skip to content

Commit

Permalink
improved linting workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bmos authored Dec 29, 2024
1 parent 125e52d commit 1ff33f5
Showing 1 changed file with 38 additions and 21 deletions.
59 changes: 38 additions & 21 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,42 @@ on:
branches:
- "master"

permissions:
contents: read

jobs:
ruff:
name: "Ruff"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/checkout@v4.1.7"

- name: "Set up Python"
uses: actions/setup-python@v5.1.0
with:
python-version: "3.12"
cache: "pip"

- name: "Install requirements"
run: python3 -m pip install -r requirements.txt

- name: "Lint"
run: python3 -m ruff check .

- name: "Format"
run: python3 -m ruff format . --check
ruff-format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python 3.12
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.12"

- name: "Install requirements"
run: python3 -m pip install -r requirements.txt

- name: Run ruff format
run: |
ruff format --diff --target-version=py312 .
ruff:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python 3.12
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.12"

- name: "Install requirements"
run: python3 -m pip install -r requirements.txt

- name: Run ruff
run: |
ruff check --output-format=github .

0 comments on commit 1ff33f5

Please sign in to comment.