Merge pull request #6841 from vector-im/feature/bma/frozen_classes

Feature/bma/frozen classes
This commit is contained in:
Benoit Marty 2022-08-16 11:53:39 +02:00 committed by GitHub
commit 680dc207c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 15 deletions

View File

@ -23,6 +23,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 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 contains a Sign-Off, with exception for Element employee contributors
- PR with change on layout should include screenshot in the description - PR with change on layout should include screenshot in the description
- PR which adds png file warn about the usage of vector drawables - PR which adds png file warn about the usage of vector drawables

View File

@ -16,21 +16,6 @@
# limitations under the License. # limitations under the License.
# #
#######################################################################################################################
# Check frozen class modification
#######################################################################################################################
echo "Check if frozen class modified"
git diff "HEAD@{1}" --name-only | grep -e OlmInboundGroupSessionWrapper.kt -e OlmInboundGroupSessionWrapper2.kt
FROZEN_CHANGED=$?
if [ ${FROZEN_CHANGED} -eq 0 ]; then
echo "❌ FROZEN CLASS CHANGED ERROR"
exit 1
else
echo "Frozen check OK"
fi
####################################################################################################################### #######################################################################################################################
# Check drawable quantity # Check drawable quantity
####################################################################################################################### #######################################################################################################################

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 // Check for a sign-off
const signOff = "Signed-off-by:" const signOff = "Signed-off-by:"