Skip to content

add ruff gh workflow #1

add ruff gh workflow

add ruff gh workflow #1

Workflow file for this run

name: ruff
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
jobs:
ruff:
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- name: Checkout code
uses: actions/checkout@v5
with:
sparse-checkout: |
pytm
pyproject.toml
.github/workflows/ruff.yml
# https://github.com/astral-sh/ruff-action
# https://docs.astral.sh/ruff/formatter/
- name: Check production code format
uses: astral-sh/ruff-action@v3
with:
src: pytm
version: "latest"
args: "format --check"
- name: Check production code
uses: astral-sh/ruff-action@v3
with:
src: pytm
version: "latest"
args: "check --output-format=github"
# https://docs.astral.sh/ruff/linter/
- name: Show helpful safe production code fixes
uses: astral-sh/ruff-action@v3
with:
src: pytm
version: "latest"
args: "check --fix --diff --output-format=github"
continue-on-error: true
- name: Show potentially helpful unsafe production code fixes
uses: astral-sh/ruff-action@v3
with:
src: pytm
version: "latest"
args: "check --fix --diff --unsafe-fixes --output-format=github"
continue-on-error: true