1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
version: "3"
vars:
RUNNER:
sh: 'echo {{ .RUNNER | default "uv run " }}'
SOURCES: .
SOURCES_ROOT: .
tasks:
default:
cmd:
task: all
lint:
desc: Lint python source files
cmds:
- "{{.RUNNER}} ruff check {{.SOURCES}}"
- "{{.RUNNER}} ruff format --check --diff {{.SOURCES}}"
format:
desc: Format python source files
aliases: ["fmt"]
cmds:
- "{{.RUNNER}} ruff format {{ .SOURCES }}"
- "{{.RUNNER}} ruff check --fix {{.SOURCES}}"
deptry:
desc: Check used dependencies with deptry
cmd: "{{.RUNNER}} deptry {{.SOURCES_ROOT}}"
typecheck:
desc: Perform type-checking
cmd: "{{.RUNNER}} mypy {{.SOURCES}}"
test:
desc: Run tests
cmds:
- "{{.RUNNER}} pytest -n auto --cov"
all:
desc: Run the standard set of checks performed in CI
cmds:
- task: format
- task: deptry
- task: typecheck
- task: test
|