mirror of
https://github.com/pablorevilla-meshtastic/meshview.git
synced 2026-03-04 23:27:46 +01:00
Automate ruff in github action
This commit is contained in:
39
.github/workflows/lint.yml
vendored
Normal file
39
.github/workflows/lint.yml
vendored
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user