esp-idf/.gitlab/dangerjs/mrDescriptionLongEnough.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
658 B
JavaScript

/**
* Check if MR Description has accurate description".
*
* @dangerjs WARN
*/
module.exports = function () {
const mrDescription = danger.gitlab.mr.description;
const descriptionChunk = mrDescription.match(/^([^#]*)/)[1].trim(); // Extract all text before the first section header (i.e., the text before the "## Release notes")
const shortMrDescriptionThreshold = 50; // Description is considered too short below this number of characters
if (descriptionChunk.length < shortMrDescriptionThreshold) {
return warn(
"The MR description looks very brief, please check if more details can be added."
);
}
};