Repository navigation
[CodeStyle] trailing whitespace hook for .hook and .yaml - #46081
Merged
luotao1 merged 8 commits intoSep 19, 2022
Merged
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
SigureMo
commented
Sep 15, 2022
| exclude: | | ||
| (?x)^( | ||
| patches/.+ | ||
| )$ |
Collaborator
Author
There was a problem hiding this comment.
直接全局排除掉这些文件,避免每个 hook 下都写一遍
| 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|hook)|BUILD|.*\.BUILD|WORKSPACE|CMakeLists\.txt)$ |
Collaborator
Author
There was a problem hiding this comment.
这里是正则语法,. 是通配符,虽然 CMakeLists.txt 没啥问题,但明显 CMakeLists\.txt 更严谨些
SigureMo
commented
Sep 18, 2022
| 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)$ |
Collaborator
Author
There was a problem hiding this comment.
增加了 yml 后缀的 yaml 文件,为 GitHub issue form 模板,trailing whitespace 不会影响渲染效果,存量也在相应 PR 修复
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR types
Others
PR changes
Others
Describe
修改 pre-commit 配置,增加 hook 和 yaml 文件