esp-idf/.gitlab/dangerjs/mrCommitsTooManyCommits.js
Tomas Sebestik 7c58a38e88 Add improved check for Jira links
Break DangerJS checks to modules
Improove "Release notes" section detection
Change check for size MR to async/await syntax
Update check for MR title - exact match WIP and DRAFT
Add check for incorrect format closing Jira link
Update check WIP in MR title
2023-03-06 13:43:25 +01:00

18 lines
550 B
JavaScript

/**
* 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 mrCommits = danger.gitlab.commits;
if (mrCommits.length > tooManyCommitThreshold) {
return message(
`You might consider squashing your ${mrCommits.length} commits (simplifying branch history).`
);
}
};