Let danger check for frozen classes

This commit is contained in:
Benoit Marty 2022-08-16 11:37:48 +02:00
parent 08fff48065
commit 1389262c3f
2 changed files with 14 additions and 0 deletions

View file

@ -23,6 +23,7 @@ Here are the checks that Danger does so far:
- PR description is not empty
- Big PR got a warning to recommend to split
- PR contains a file for towncrier and extension is checked
- PR does not modify frozen classes
- PR contains a Sign-Off, with exception for Element employee contributors
- PR with change on layout should include screenshot in the description
- PR which adds png file warn about the usage of vector drawables

View file

@ -52,6 +52,19 @@ if (requiresChangelog) {
}
}
// check that frozen classes have not been modified
const frozenClasses = [
"OlmInboundGroupSessionWrapper.kt",
"OlmInboundGroupSessionWrapper2.kt",
]
frozenClasses.forEach(frozen => {
if (editedFiles.some(file => file.endsWith(frozen))) {
fail("Frozen class `" + frozen + "` has been modified. Please do not modify frozen class.")
}
}
)
// Check for a sign-off
const signOff = "Signed-off-by:"