feat(pre-commit):集成pre-commit-hooks和pre-commit-java以提升代码质量

新增检查工具集成,包括pre-commit-hooks v2.3.0和pre-commit-java v0.5.4,以自动化代码样式和质量验证。这些工具将帮助检测并修正yaml格式问题、修复文件末尾换行、修剪尾随空格,并执行Java代码的静态分析和风格检查,排除测试目录。
This commit is contained in:
suyiiyii 2024-08-16 21:25:14 +08:00
parent 675c07939e
commit 7d016f8562

17
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,17 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/gherynos/pre-commit-java
rev: v0.5.4
hooks:
- id: pmd
exclude: /test/
- id: cpd
exclude: /test/
- id: checkstyle
exclude: /test/