Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{CI} add some new rules to check pull request title and history note. #21493

Merged
merged 1 commit into from
Mar 4, 2022
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
18 changes: 17 additions & 1 deletion scripts/ci/check_pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,13 @@ def regex_line(line):
logger.info('%s%s: missing ` around %s', line, yellow, command)
logger.error(' ' * idx + '↑' + ' ' * (index - idx - 2) + '↑')
error_flag = True
# First word after the colon must be capitalized
if i == ':':
# check extra space character before colon
if idx - 1 >= 0 and line[idx - 1] == ' ':
logger.info('%s%s: please delete extra space character before :', line, yellow)
logger.error(' ' * (idx - 1) + '↑')
error_flag = True
# First word after the colon must be capitalized
index = 0
if line[idx + 1] == ' ' and line[idx + 2].islower() and line[idx + 2: idx + 5] != 'az ':
index = idx + 2
Expand Down Expand Up @@ -163,6 +168,17 @@ def regex_line(line):
'follow https://aka.ms/submitAzPR\n', red, word, yellow, green, k, yellow)
error_flag = True
break
# check extra consecutive spaces
if i == ' ' and (idx + 1) < len(line) and line[idx + 1] == ' ':
logger.info('%s%s: please delete the extra space character', line, yellow)
logger.error(' ' * (idx + 1) + '↑')
error_flag = True

# last character check
if line[-1] in ['.', ',', ' ']:
logger.info('%s%s: please delete the last character', line, yellow)
logger.error(' ' * idx + '↑')
error_flag = True

return error_flag

Expand Down