Skip to content

Commit

Permalink
implement ruff based workflow to check all python files are linted an…
Browse files Browse the repository at this point in the history
…d formatted
  • Loading branch information
dpgraham4401 committed Oct 4, 2024
1 parent 8943a02 commit 771c69d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/lint_server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint Python files
on:
pull_request:
paths:
- "server/**"
- ".github/workflows/*"
push:
paths:
- "server/**"
- ".github/workflows/*"
workflow_call:
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./server
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install -r requirements_dev.txt
- name: Lint Python files
run: |
ruff check . -e
- name: Format Python files
run: |
ruff format . --check
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repos:
rev: v0.5.6
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --config, ./server/pyproject.toml]
args: [--fix, --config, ./server/pyproject.toml]
- id: ruff-format
args: [--config, ./server/pyproject.toml]
# Check django migrations
Expand Down

0 comments on commit 771c69d

Please sign in to comment.