-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
98 lines (89 loc) · 2.82 KB
/
.pre-commit-config.yaml
File metadata and controls
98 lines (89 loc) · 2.82 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Pre-commit configuration for eoAPI Kubernetes charts
# Fast, essential checks only - heavy validation moved to CI
repos:
# Basic file formatting and validation
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: ['--allow-multiple-documents']
exclude: ^charts/.+/templates/
- id: check-added-large-files
# YAML linting
- repo: https://github.com/adrienverge/yamllint
rev: v1.37.1
hooks:
- id: yamllint
files: \.(yaml|yml)$
exclude: ^charts/.+/templates/
# Shell script validation
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
args: ['-e', 'SC1091']
# GitHub Actions linting
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
- id: actionlint
# Python linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
# Linter
- id: ruff
name: ruff lint
args: ['--fix']
files: ^tests\/.*\.py$
# Formatter
- id: ruff-format
name: ruff format
files: ^tests\/.*\.py$
# Python type checking for all test files
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
- id: mypy
name: mypy type checking for tests
args: ['--ignore-missing-imports', '--no-strict-optional']
files: ^tests\/.*\.py$
additional_dependencies:
- 'types-psycopg2'
- 'types-requests'
- 'httpx'
- 'pytest'
- 'kubernetes'
# Fast Helm syntax check only
- repo: local
hooks:
- id: helm-lint-syntax
name: Helm Syntax Check
entry: >
bash -c 'for chart in charts/*/; do
if [ -f "$chart/Chart.yaml" ]; then
if grep -q "dependencies:" "$chart/Chart.yaml" 2>/dev/null; then
if [ -d "$chart/charts" ] && [ -n "$(find "$chart/charts" -name "*.tgz" 2>/dev/null)" ]; then
echo "Linting $chart (dependencies available)...";
helm lint "$chart" --strict || exit 1;
else echo "Skipping $chart (dependencies not built - run make deploy or scripts/helm-setup.sh first)";
fi; else echo "Linting $chart (no dependencies)...";
helm lint "$chart" --strict || exit 1; fi; fi; done'
language: system
files: ^charts/.+\.(yaml|yml)$
pass_filenames: false
- id: helm-schema-validation
name: Helm Schema Validation
entry: ./eoapi-cli test schema
language: system
files: ^charts/.+\.(json|yaml|yml)$
pass_filenames: false
# Exclude directories
exclude: |
(?x)^(
\.git/.*|
charts/.+/charts/.*|
charts/.+/tmpcharts.*/.*
)$