Skip to content
Open
Show file tree
Hide file tree
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
19 changes: 4 additions & 15 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,23 +304,12 @@ function validatePRTitle(title) {
else {
result.labelsToRemove.push(TitleLabel.TYPE_MISSING);
}
// References
if (parsed.references.length === 0) {
result.labelsToAdd.push(TitleLabel.ISSUE_REFERENCE_MISSING);
}
else {
result.labelsToRemove.push(TitleLabel.ISSUE_REFERENCE_MISSING);
}
// References — check disabled; always clear the label so existing PRs self-clean
result.labelsToRemove.push(TitleLabel.ISSUE_REFERENCE_MISSING);
// Subject
if (parsed.subject != null) {
// Capitalisation
const firstChar = parsed.subject.slice(0, 1);
if (firstChar !== firstChar.toUpperCase()) {
result.labelsToAdd.push(TitleLabel.TITLE_NOT_CAPITALISED);
}
else {
result.labelsToRemove.push(TitleLabel.TITLE_NOT_CAPITALISED);
}
// Capitalisation — check disabled; always clear the label so existing PRs self-clean
result.labelsToRemove.push(TitleLabel.TITLE_NOT_CAPITALISED);
Comment on lines 309 to +312
// Don't end with period
const lastChar = parsed.subject.slice(-1);
if (lastChar === '.') {
Expand Down
18 changes: 4 additions & 14 deletions src/verifyPRTitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,13 @@ async function validatePRTitle(title: string): Promise<Result> {
result.labelsToRemove.push(TitleLabel.TYPE_MISSING);
}

// References
if (parsed.references.length === 0) {
result.labelsToAdd.push(TitleLabel.ISSUE_REFERENCE_MISSING);
} else {
result.labelsToRemove.push(TitleLabel.ISSUE_REFERENCE_MISSING);
}
// References — check disabled; always clear the label so existing PRs self-clean
result.labelsToRemove.push(TitleLabel.ISSUE_REFERENCE_MISSING);

// Subject
if (parsed.subject != null) {
// Capitalisation
const firstChar = parsed.subject.slice(0, 1);

if (firstChar !== firstChar.toUpperCase()) {
result.labelsToAdd.push(TitleLabel.TITLE_NOT_CAPITALISED);
} else {
result.labelsToRemove.push(TitleLabel.TITLE_NOT_CAPITALISED);
}
// Capitalisation — check disabled; always clear the label so existing PRs self-clean
result.labelsToRemove.push(TitleLabel.TITLE_NOT_CAPITALISED);
Comment on lines 38 to +41

// Don't end with period
const lastChar = parsed.subject.slice(-1);
Expand Down