mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-26 18:42:31 +03:00
d60ef81ede
This PR sets up [Danger](https://danger.systems/js/) to help us codify some of our PR rules. As an initial rule, Danger will check to ensure that every PR has a `Release Notes` section: <img width="943" alt="Screenshot 2024-01-29 at 11 50 12 AM" src="https://github.com/zed-industries/zed/assets/1486634/4d56e759-e72f-4bc0-8e74-42c55e2e6888"> Release Notes: - N/A
28 lines
769 B
TypeScript
28 lines
769 B
TypeScript
import { danger, warn } from "danger";
|
|
|
|
const RELEASE_NOTES_PATTERN = new RegExp("Release Notes:\\r?\\n\\s+-", "gm");
|
|
|
|
const hasReleaseNotes = RELEASE_NOTES_PATTERN.test(danger.github.pr.body);
|
|
if (!hasReleaseNotes) {
|
|
warn(
|
|
[
|
|
"This PR is missing release notes.",
|
|
"",
|
|
'Please add a "Release Notes" section that describes the change:',
|
|
"",
|
|
"```",
|
|
"Release Notes:",
|
|
"",
|
|
"- (Added|Fixed|Improved) ... ([#<public_issue_number_if_exists>](https://github.com/zed-industries/zed/issues/<public_issue_number_if_exists>)).",
|
|
"```",
|
|
"",
|
|
'If your change is not user-facing, you can use "N/A" for the entry:',
|
|
"```",
|
|
"Release Notes:",
|
|
"",
|
|
"- N/A",
|
|
"```",
|
|
].join("\n"),
|
|
);
|
|
}
|