Towncrier is gone, iterate on danger checks
This commit is contained in:
@@ -22,7 +22,7 @@ Here are the checks that Danger does so far:
|
|||||||
|
|
||||||
- PR description is not empty
|
- PR description is not empty
|
||||||
- Big PR got a warning to recommend to split
|
- Big PR got a warning to recommend to split
|
||||||
- PR contains a file for towncrier and extension is checked
|
- PR contains a correct title and a label to categorize the release note
|
||||||
- PR does not modify frozen classes
|
- PR does not modify frozen classes
|
||||||
- PR contains a Sign-Off, with exception for Element employee contributors
|
- PR contains a Sign-Off, with exception for Element employee contributors
|
||||||
- PR with change on layout should include screenshot in the description (TODO Not supported yet!)
|
- PR with change on layout should include screenshot in the description (TODO Not supported yet!)
|
||||||
|
|||||||
@@ -27,30 +27,14 @@ if (editedFiles.length > 50) {
|
|||||||
message("This pull request seems relatively large. Please consider splitting it into multiple smaller ones.")
|
message("This pull request seems relatively large. Please consider splitting it into multiple smaller ones.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request a changelog for each PR
|
// Request a correct title for each PR
|
||||||
const changelogAllowList = [
|
if (pr.title.endsWith("…")) {
|
||||||
"dependabot[bot]",
|
fail("Please provide a complete title that can be used as a changelog entry.")
|
||||||
]
|
}
|
||||||
|
|
||||||
const requiresChangelog = !changelogAllowList.includes(user)
|
// Request a `PR-` label for each PR
|
||||||
|
if (pr.labels.filter((label) => label.name.startsWith("PR-")).length != 1) {
|
||||||
if (requiresChangelog) {
|
fail("Please add a `PR-` label to categorise the changelog entry.")
|
||||||
const changelogFiles = editedFiles.filter(file => file.startsWith("changelog.d/"))
|
|
||||||
|
|
||||||
if (changelogFiles.length == 0) {
|
|
||||||
warn("Please add a changelog. See instructions [here](https://github.com/element-hq/element-android/blob/develop/CONTRIBUTING.md#changelog)")
|
|
||||||
} else {
|
|
||||||
const validTowncrierExtensions = [
|
|
||||||
"bugfix",
|
|
||||||
"doc",
|
|
||||||
"feature",
|
|
||||||
"misc",
|
|
||||||
"wip",
|
|
||||||
]
|
|
||||||
if (!changelogFiles.every(file => validTowncrierExtensions.includes(file.split(".").pop()))) {
|
|
||||||
fail("Invalid extension for changelog. See instructions [here](https://github.com/element-hq/element-android/blob/develop/CONTRIBUTING.md#changelog)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check that frozen classes have not been modified
|
// check that frozen classes have not been modified
|
||||||
|
|||||||
Reference in New Issue
Block a user