Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
exclude: |
(?x)^(
patches/.+
)$

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接全局排除掉这些文件,避免每个 hook 下都写一遍

参考:.pre-commit-config.yaml - top level

repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
rev: v1.1.14
Expand Down Expand Up @@ -26,7 +30,7 @@ repos:
- id: sort-simple-yaml
files: (api|backward|api_[a-z_]+)\.yaml$
- id: trailing-whitespace
files: (.*\.(py|bzl|md|rst|c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps|cmake)|BUILD|.*\.BUILD|WORKSPACE|CMakeLists.txt)$
files: (.*\.(py|bzl|md|rst|c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps|cmake|yaml|yml|hook)|BUILD|.*\.BUILD|WORKSPACE|CMakeLists\.txt)$

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加了 yml 后缀的 yaml 文件,为 GitHub issue form 模板,trailing whitespace 不会影响渲染效果,存量也在相应 PR 修复

- repo: local
hooks:
- id: clang-format
Expand Down