已开启
chore: 新增pre-commit-config配置文件 #1
masiyu创建于 6月22日
chore: 新增pre-commit-config配置文件 #1
已开启
共 10 个文件变更+321-68
| @@ -0,0 +1,6 @@ | |||
| 1 | +column_width = 120 | ||
| 2 | +indent_type = "Spaces" | ||
| 3 | +indent_width = 4 | ||
| 4 | +quote_style = "ForceSingle" | ||
| 5 | +collapse_simple_statement = "Never" | ||
| 6 | +line_endings = "Unix" | ||
| @@ -14,15 +14,14 @@ reimplemented in Python for cross-platform support. | |||
| 14 | 14 | ||
| 15 | Usage: add_signoff_and_change_id.py <commit-msg-file> | 15 | Usage: add_signoff_and_change_id.py <commit-msg-file> |
| 16 | """ | 16 | """ |
| 17 | + | ||
| 17 | import hashlib | 18 | import hashlib |
| 18 | import os | 19 | import os |
| 19 | import re | 20 | import re |
| 20 | import subprocess | 21 | import subprocess |
| 21 | import sys | 22 | import sys |
| 22 | 23 | ||
| 23 | -TRAILER_RE = re.compile( | 24 | +TRAILER_RE = re.compile(r"^(Co-Authored-By|Signed-off-by|Change-Id|Reviewed-by|Tested-by|Acked-by):") |
| 24 | - r"^(Co-Authored-By|Signed-off-by|Change-Id|Reviewed-by|Tested-by|Acked-by):" | ||
| 25 | -) | ||
| 26 | 25 | ||
| 27 | 26 | ||
| 28 | def _git_config(key: str) -> str: | 27 | def _git_config(key: str) -> str: |
| @@ -12,6 +12,7 @@ Usage: conventional_commit.py <commit-msg-file> [allowed-type ...] | |||
| 12 | 12 | ||
| 13 | If no allowed types are specified, all standard types are permitted. | 13 | If no allowed types are specified, all standard types are permitted. |
| 14 | """ | 14 | """ |
| 15 | + | ||
| 15 | import re | 16 | import re |
| 16 | import sys | 17 | import sys |
| 17 | 18 | ||