dangerjs: Improve check for git commit messages

This commit is contained in:
Tomas Sebestik
2023-03-08 11:00:04 +01:00
parent 7002a5ce10
commit 58d7db6e5d
4 changed files with 58 additions and 26 deletions
+1 -3
View File
@@ -1,12 +1,10 @@
/**
* Check if MR has not an excessive numbers of commits (if squashed)
*
* #TODO: this simple logic will be improved in future MRs - Jira IDF-6856.
*
* @dangerjs INFO
*/
module.exports = function () {
const tooManyCommitThreshold = 5; // above this number of commits, squash is recommended
const tooManyCommitThreshold = 2; // above this number of commits, squash commits is suggested
const mrCommits = danger.gitlab.commits;
if (mrCommits.length > tooManyCommitThreshold) {