mirror of
https://github.com/trailofbits/dropkit
synced 2026-06-21 14:11:54 +00:00
f6bb0e9aca
* Add E2E lifecycle test for create/destroy workflow Bash script that exercises the full droplet lifecycle: create (no Tailscale), verify SSH config, run commands over SSH, destroy, and verify cleanup --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: dm <alexis.challande@trailofbits.com>
64 lines
1.7 KiB
YAML
64 lines
1.7 KiB
YAML
# Pre-commit configuration
|
|
# Run with: prek run (or prek run --all-files)
|
|
|
|
default_language_version:
|
|
python: python3.11
|
|
|
|
repos:
|
|
# Ruff - official pre-commit hooks (faster than local)
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
rev: v0.14.14
|
|
hooks:
|
|
- id: ruff-check
|
|
args: [--fix]
|
|
- id: ruff-format
|
|
|
|
# prek builtin hooks - fast, no external deps
|
|
- repo: builtin
|
|
hooks:
|
|
- id: trailing-whitespace
|
|
- id: end-of-file-fixer
|
|
- id: check-yaml
|
|
exclude: ^dropkit/templates/ # Jinja2 templates aren't valid YAML
|
|
- id: check-toml
|
|
- id: check-merge-conflict
|
|
- id: check-added-large-files
|
|
|
|
# ty type checking (no official pre-commit hook, use local)
|
|
- repo: local
|
|
hooks:
|
|
- id: ty-check
|
|
name: ty type check
|
|
entry: uv run ty check dropkit/
|
|
language: system
|
|
types: [python]
|
|
pass_filenames: false
|
|
|
|
# Jinja2 template validation
|
|
- repo: local
|
|
hooks:
|
|
- id: jinja2-check
|
|
name: jinja2 template syntax
|
|
entry: uv run python -c "import sys; from jinja2 import Template; [Template(open(f).read()) for f in sys.argv[1:]]"
|
|
language: system
|
|
files: ^dropkit/templates/.*\.yaml$
|
|
types: [file]
|
|
|
|
# Shell script linting
|
|
- repo: https://github.com/koalaman/shellcheck-precommit
|
|
rev: v0.10.0
|
|
hooks:
|
|
- id: shellcheck
|
|
args: [--severity=error]
|
|
|
|
# E2E lifecycle test (creates a real droplet, requires valid config)
|
|
- repo: local
|
|
hooks:
|
|
- id: e2e-lifecycle
|
|
name: E2E lifecycle test
|
|
entry: ./tests/e2e/test_lifecycle.sh
|
|
language: system
|
|
pass_filenames: false
|
|
always_run: true
|
|
stages: [manual]
|