mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
18 lines
550 B
JavaScript
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).`
|
||
|
);
|
||
|
}
|
||
|
};
|