File tree Expand file tree Collapse file tree 2 files changed +20
-11
lines changed
Expand file tree Collapse file tree 2 files changed +20
-11
lines changed Original file line number Diff line number Diff line change 1+ ---
12# Simplified pre-commit config (if full version has issues)
23# This version uses local hooks and doesn't require external repos
34
@@ -10,37 +11,42 @@ repos:
1011 entry : bash -c 'sed -i "s/[[:space:]]*$//" "$@"' --
1112 language : system
1213 files : \.(py|yaml|yml|sh|md)$
13-
14+
1415 - id : end-of-file-fixer
1516 name : Fix End of Files
1617 entry : bash -c 'for f in "$@"; do [ -s "$f" ] && [ "$(tail -c1 "$f")" != "" ] && echo >> "$f"; done' --
1718 language : system
1819 files : \.(py|yaml|yml|sh|md)$
19-
20+
2021 - id : check-yaml
2122 name : Check YAML
2223 entry : bash -c 'for f in "$@"; do python3 -c "import yaml; yaml.safe_load(open(\"$f\"))" || exit 1; done' --
2324 language : system
2425 files : \.(yaml|yml)$
25-
26+
2627 - id : detect-private-key
2728 name : Detect Private Keys
2829 entry : bash -c 'grep -l "BEGIN.*PRIVATE KEY" "$@" && exit 1 || exit 0' --
2930 language : system
3031 files : .*
31-
32+
3233 - id : airflow-dag-validation
3334 name : Airflow DAG Validation
3435 entry : bash -c 'cd "$(git rev-parse --show-toplevel)" && ./scripts/validate-dags.sh' --
3536 language : system
3637 files : ^dags/.*\.py$
3738 pass_filenames : false
3839 always_run : true
39-
40+
4041 - id : gitleaks-local
41- name : Gitleaks (if installed)
42- entry : bash -c 'if command -v gitleaks >/dev/null; then gitleaks detect --no-banner --source . --verbose; else echo "gitleaks not installed, skipping"; fi' --
42+ name : Gitleaks (if installed, push only)
43+ entry : >
44+ bash -c 'if command -v gitleaks >/dev/null; then
45+ gitleaks detect --no-banner --source . --verbose
46+ else
47+ echo "gitleaks not installed, skipping"
48+ fi' --
4349 language : system
4450 pass_filenames : false
45- always_run : true
46-
51+ stages : [push]
52+ # Only runs on push to block secrets from reaching remote
Original file line number Diff line number Diff line change 1+ ---
12# Pre-commit hooks for qubinode-pipelines
23# Install with: pip install pre-commit && pre-commit install
34# Run manually: pre-commit run --all-files
@@ -48,13 +49,15 @@ repos:
4849 stages : [commit]
4950 fail_fast : false
5051
51- # Secret detection with gitleaks
52+ # Secret detection with gitleaks (blocks pushes, allows commits)
5253 - repo : https://github.com/gitleaks/gitleaks
5354 rev : v8.18.0
5455 hooks :
5556 - id : gitleaks
5657 args : ['--no-banner', '--verbose']
57- stages : [commit, push]
58+ stages : [push]
59+ # Only runs on push to block secrets from reaching remote
60+ # Commits are allowed to proceed for local development
5861
5962 # YAML validation (for Airflow configs, etc.)
6063 - repo : https://github.com/adrienverge/yamllint
You can’t perform that action at this time.
0 commit comments