diff --git a/.github/workflows/lint_server.yaml b/.github/workflows/lint_server.yaml new file mode 100644 index 00000000..0f298063 --- /dev/null +++ b/.github/workflows/lint_server.yaml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 67b93ea9..87ed5337 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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