mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Add ruff pre-commit hook
Add configuration for pre-commit, ruff as a hook and configuration to run ruff whenever a pull request is opened or code is pushed.
This commit is contained in:
parent
c49d4eedd0
commit
d055090dd2
3 changed files with 37 additions and 0 deletions
12
.gitea/workflows/pre-commit.yml
Normal file
12
.gitea/workflows/pre-commit.yml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
name: pre-commit
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: pre-commit/action@v3.0.1
|
||||
15
.pre-commit-config.yaml
Normal file
15
.pre-commit-config.yaml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.6.1
|
||||
hooks:
|
||||
- id: ruff
|
||||
args:
|
||||
- --output-format=full
|
||||
exclude: ^source/tools/webservices/
|
||||
- id: ruff-format
|
||||
args:
|
||||
- --check
|
||||
- --target-version
|
||||
- py311
|
||||
exclude: ^source/tools/webservices/
|
||||
10
ruff.toml
Normal file
10
ruff.toml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
line-length = 99
|
||||
|
||||
[lint.isort]
|
||||
lines-after-imports = 2
|
||||
|
||||
[lint.pycodestyle]
|
||||
max-doc-length = 72
|
||||
|
||||
[lint.pydocstyle]
|
||||
convention = "pep257"
|
||||
Loading…
Reference in a new issue