From 7d016f856291d79f7e9bbcbbb27682ac65401a0c Mon Sep 17 00:00:00 2001 From: suyiiyii Date: Fri, 16 Aug 2024 21:25:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(pre-commit):=E9=9B=86=E6=88=90pre-commit-h?= =?UTF-8?q?ooks=E5=92=8Cpre-commit-java=E4=BB=A5=E6=8F=90=E5=8D=87?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增检查工具集成,包括pre-commit-hooks v2.3.0和pre-commit-java v0.5.4,以自动化代码样式和质量验证。这些工具将帮助检测并修正yaml格式问题、修复文件末尾换行、修剪尾随空格,并执行Java代码的静态分析和风格检查,排除测试目录。 --- .pre-commit-config.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..23fb352 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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/ \ No newline at end of file