1- # Pre-commit hooks configuration
2- # See https://pre-commit.com for more information
1+ # Pre-commit hooks configuration for comprehensive testing
2+ # This configuration ensures code quality across all languages and file types
33
44repos :
5+ # General hooks
56 - repo : https://github.com/pre-commit/pre-commit-hooks
6- rev : v4.5 .0
7+ rev : v4.4 .0
78 hooks :
89 - id : trailing-whitespace
9- args : [--markdown-linebreak-ext=md]
10+ name : Remove trailing whitespace
11+ description : Remove trailing whitespace from files
12+ types : [text]
1013 - id : end-of-file-fixer
14+ name : Fix end of file
15+ description : Ensure files end with a newline
16+ types : [text]
1117 - id : check-yaml
12- args : [--allow-multiple-documents]
18+ name : Check YAML syntax
19+ description : Check YAML files for syntax errors
20+ types : [yaml]
1321 - id : check-json
14- - id : check-added-large-files
15- args : [--maxkb=5000]
22+ name : Check JSON syntax
23+ description : Check JSON files for syntax errors
24+ types : [json]
25+ - id : check-toml
26+ name : Check TOML syntax
27+ description : Check TOML files for syntax errors
28+ types : [toml]
1629 - id : check-merge-conflict
30+ name : Check for merge conflict markers
31+ description : Check for merge conflict markers in files
32+ types : [text]
33+ - id : check-added-large-files
34+ name : Check for large files
35+ description : Prevent large files from being committed
36+ args : ['--maxkb=1000']
1737 - id : check-case-conflict
18- - id : detect-private-key
38+ name : Check for case conflicts
39+ description : Check for case conflicts in filenames
40+ - id : check-executables-have-shebangs
41+ name : Check executables have shebangs
42+ description : Ensure executable files have proper shebangs
43+ types : [text]
44+ - id : check-shebang-scripts-are-executable
45+ name : Check shebang scripts are executable
46+ description : Ensure shebang scripts are executable
47+ types : [text]
1948
49+ # JavaScript/TypeScript hooks
2050 - repo : https://github.com/pre-commit/mirrors-eslint
21- rev : v8.56 .0
51+ rev : v8.50 .0
2252 hooks :
2353 - id : eslint
24- files : \.(js|ts|tsx|vue)$
25- types : [file]
26- args : [--fix, --max-warnings=0 ]
54+ name : ESLint
55+ description : Run ESLint on JavaScript/TypeScript files
56+ types : [javascript, typescript, vue ]
2757 additional_dependencies :
28- 58+ 59+ -
' @typescript-eslint/[email protected] ' 60+ -
' @typescript-eslint/[email protected] ' 61+ 62+ 63+ args : ['--fix', '--max-warnings', '0']
64+ files : \.(js|ts|vue)$
65+
66+ - repo : https://github.com/pre-commit/mirrors-prettier
67+ rev : v3.0.3
68+ hooks :
69+ - id : prettier
70+ name : Prettier
71+ description : Format code with Prettier
72+ types : [javascript, typescript, vue, json, yaml, markdown]
73+ args : ['--write']
74+ files : \.(js|ts|vue|json|yml|yaml|md)$
75+
76+ # Python hooks
77+ - repo : https://github.com/psf/black
78+ rev : 23.7.0
79+ hooks :
80+ - id : black
81+ name : Black
82+ description : Format Python code with Black
83+ language_version : python3
84+ types : [python]
85+ args : ['--line-length', '88']
86+
87+ - repo : https://github.com/pycqa/isort
88+ rev : 5.12.0
89+ hooks :
90+ - id : isort
91+ name : isort
92+ description : Sort Python imports
93+ types : [python]
94+ args : ['--profile', 'black']
95+
96+ - repo : https://github.com/pycqa/flake8
97+ rev : 6.0.0
98+ hooks :
99+ - id : flake8
100+ name : Flake8
101+ description : Lint Python code with Flake8
102+ types : [python]
103+ args : ['--max-line-length=88', '--extend-ignore=E203,W503']
104+
105+ - repo : https://github.com/pre-commit/mirrors-mypy
106+ rev : v1.5.1
107+ hooks :
108+ - id : mypy
109+ name : MyPy
110+ description : Type check Python code
111+ types : [python]
112+ additional_dependencies : [types-all]
113+ args : ['--ignore-missing-imports']
114+
115+ # Java hooks
116+ - repo : https://github.com/diffplug/spotless
117+ rev : 6.20.0
118+ hooks :
119+ - id : spotless-java
120+ name : Spotless Java
121+ description : Format Java code with Spotless
122+ types : [java]
123+ args : ['apply']
124+
125+ - repo : local
126+ hooks :
127+ - id : checkstyle-java
128+ name : Checkstyle Java
129+ description : Run Checkstyle on Java files
130+ entry : mvn checkstyle:check
131+ language : system
132+ types : [java]
133+ pass_filenames : false
134+
135+ # Go hooks (if Go files exist)
136+ - repo : https://github.com/dnephin/pre-commit-golang
137+ rev : v1.0.0
138+ hooks :
139+ - id : go-fmt
140+ name : Go fmt
141+ description : Format Go code
142+ types : [go]
143+ - id : go-imports
144+ name : Go imports
145+ description : Format Go imports
146+ types : [go]
147+ - id : go-vet
148+ name : Go vet
149+ description : Run go vet
150+ types : [go]
151+ - id : go-test
152+ name : Go test
153+ description : Run go test
154+ types : [go]
155+
156+ # Rust hooks (if Rust files exist)
157+ - repo : https://github.com/doublify/pre-commit-rust
158+ rev : v1.0
159+ hooks :
160+ - id : rustfmt
161+ name : Rust fmt
162+ description : Format Rust code
163+ types : [rust]
164+ - id : clippy
165+ name : Clippy
166+ description : Run Clippy linter
167+ types : [rust]
168+
169+ # Docker hooks
170+ - repo : https://github.com/hadolint/hadolint
171+ rev : v2.12.0
172+ hooks :
173+ - id : hadolint
174+ name : Hadolint
175+ description : Lint Dockerfiles
176+ types : [dockerfile]
177+
178+ # Shell hooks
179+ - repo : https://github.com/shellcheck-py/shellcheck-py
180+ rev : v0.9.0.6
181+ hooks :
182+ - id : shellcheck
183+ name : ShellCheck
184+ description : Lint shell scripts
185+ types : [shell]
186+
187+ # Markdown hooks
188+ - repo : https://github.com/igorshubovych/markdownlint-cli
189+ rev : v0.35.0
190+ hooks :
191+ - id : markdownlint
192+ name : Markdownlint
193+ description : Lint Markdown files
194+ types : [markdown]
195+ args : ['--fix']
29196
197+ # Security hooks
198+ - repo : https://github.com/Yelp/detect-secrets
199+ rev : v1.4.0
200+ hooks :
201+ - id : detect-secrets
202+ name : Detect secrets
203+ description : Detect secrets in code
204+ args : ['--baseline', '.secrets.baseline']
205+
206+ # Custom hooks for this project
30207 - repo : local
31208 hooks :
32- - id : vitest-related
33- name : Run related tests
34- entry : npm run test:related
209+ - id : vitest-unit-tests
210+ name : Vitest Unit Tests
211+ description : Run unit tests with Vitest
212+ entry : npx vitest run --reporter=verbose
213+ language : system
214+ types : [javascript, typescript]
215+ pass_filenames : false
216+ always_run : true
217+
218+ - id : vitest-coverage-check
219+ name : Vitest Coverage Check
220+ description : Check test coverage
221+ entry : npx vitest run --coverage --reporter=json
222+ language : system
223+ types : [javascript, typescript]
224+ pass_filenames : false
225+ always_run : true
226+
227+ - id : maven-test
228+ name : Maven Test
229+ description : Run Maven tests
230+ entry : mvn test
231+ language : system
232+ types : [java]
233+ pass_filenames : false
234+ always_run : true
235+
236+ - id : python-tests
237+ name : Python Tests
238+ description : Run Python tests
239+ entry : python -m pytest test/ -v
240+ language : system
241+ types : [python]
242+ pass_filenames : false
243+ always_run : true
244+
245+ - id : comprehensive-test-suite
246+ name : Comprehensive Test Suite
247+ description : Run comprehensive test suite
248+ entry : python3 test_comprehensive.py
249+ language : system
250+ pass_filenames : false
251+ always_run : true
252+
253+ - id : build-check
254+ name : Build Check
255+ description : Ensure project builds successfully
256+ entry : npm run build
35257 language : system
36- files : \.(ts|tsx|vue)$
258+ types : [javascript, typescript]
37259 pass_filenames : false
38- stages : [commit]
260+ always_run : true
39261
40262 - id : type-check
41- name : TypeScript type check
42- entry : npm run type-check
263+ name : TypeScript Type Check
264+ description : Run TypeScript type checking
265+ entry : npx tsc --noEmit
43266 language : system
44- files : \.(ts|tsx|vue)$
267+ types : [typescript]
45268 pass_filenames : false
46- stages : [commit]
269+ always_run : true
270+
271+ - id : lint-staged
272+ name : Lint Staged
273+ description : Run lint-staged
274+ entry : npx lint-staged
275+ language : system
276+ pass_filenames : false
277+ always_run : true
278+
279+ # Configuration for specific tools
280+ ci :
281+ autofix_commit_msg : |
282+ [pre-commit.ci] auto fixes from pre-commit.com hooks
283+
284+ for more information, see https://pre-commit.ci
285+ autofix_prs : true
286+ autoupdate_branch : ' '
287+ autoupdate_commit_msg : ' [pre-commit.ci] pre-commit autoupdate'
288+ autoupdate_schedule : weekly
289+ skip : []
290+ submodules : false
291+
292+ # Default configuration
293+ default_language_version :
294+ python : python3
295+ node : 18
296+ java : 17
297+ golang : 1.21
298+ rust : stable
47299
48- default_stages : [commit]
300+ # Minimum pre-commit version
301+ minimum_pre_commit_version : 3.0.0
0 commit comments