Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 28, 2020. It is now read-only.

Commit ecf4f31

Browse files
fix: add Title case 'Revert' in header check
1 parent 735d7d3 commit ecf4f31

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎validate_commit_msg/validate.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,22 @@ def check_header(header):
140140

141141
match = re.match(HEADER_PATTERN, header)
142142
if not match:
143+
# `.` not match newline in python, so `or not match.group(5).strip()` not necessary
143144
print_error_msg(ErrorEnum.BAD_HEADER_FORMAT, header=header)
144145
return False
145146

146147
fixup_or_squash = bool(match.group(2))
147148
type_ = match.group(3)
148149
# scope = match.group(4) # TODO: 根据配置对scope检查
149-
# subject = bool(match.group(5)) # TODO: 根据规则对subject检查
150+
# subject = match.group(5) # TODO: 根据规则对subject检查
150151

151152
if type_ not in TYPE_LIST:
152153
print_error_msg(ErrorEnum.WRONG_TYPE, type=type_)
153154

154155
# print(match.group(0, 1, 2, 3, 4, 5))
155156

156157
length = len(header)
157-
if length > LINE_LIMIT and not (fixup_or_squash or type_ == 'revert'):
158+
if length > LINE_LIMIT and not (fixup_or_squash or type_ == 'revert'ortype_=='Revert'):
158159
print_error_msg(ErrorEnum.LINE_OVERLONG, length=length, line=header)
159160
return False
160161

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /