mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-16 00:47:39 +03:00
Have Danger check the format of GitHub issue links (#14684)
This PR updates the Danger rules to check for GitHub issue links that aren't in the desired format: <img width="916" alt="Screenshot 2024-07-17 at 5 11 48 PM" src="https://github.com/user-attachments/assets/c77d3c28-3b09-44aa-a97f-03c2400df2e6"> We don't yet check that the links are exactly formatted as expected, just that they aren't incorrectly formatted in the way that people typically get it wrong. Release Notes: - N/A
This commit is contained in:
parent
00c3c02f7d
commit
8ef53aafa2
@ -33,3 +33,22 @@ if (!hasReleaseNotes) {
|
|||||||
].join("\n"),
|
].join("\n"),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const INCORRECT_ISSUE_LINK_PATTERN = new RegExp("-.*\\(#\\d+\\)", "g");
|
||||||
|
|
||||||
|
const hasIncorrectIssueLinks = INCORRECT_ISSUE_LINK_PATTERN.test(
|
||||||
|
danger.github.pr.body,
|
||||||
|
);
|
||||||
|
if (hasIncorrectIssueLinks) {
|
||||||
|
warn(
|
||||||
|
[
|
||||||
|
"This PR has incorrectly formatted GitHub issue links in the release notes.",
|
||||||
|
"",
|
||||||
|
"GitHub issue links must be formatted as plain Markdown links:",
|
||||||
|
"",
|
||||||
|
"```",
|
||||||
|
"- Improved something ([#ISSUE](https://github.com/zed-industries/zed/issues/ISSUE)).",
|
||||||
|
"```",
|
||||||
|
].join("\n"),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user