diff --git a/docs/danger.md b/docs/danger.md index 19728f00e9..acf14018e6 100644 --- a/docs/danger.md +++ b/docs/danger.md @@ -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 diff --git a/tools/danger/dangerfile.js b/tools/danger/dangerfile.js index 4efd236419..c7db52fa19 100644 --- a/tools/danger/dangerfile.js +++ b/tools/danger/dangerfile.js @@ -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:"