dangerjs-wrapper
Version:
Plugin to Apply cultural rules during your CI process.
21 lines (20 loc) • 967 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkPullRequest = void 0;
const rules_1 = require("../rules");
const checkPullRequest = (dangerConfig) => {
const rules = [
{ ruleResult: rules_1.checkChangedFiles(dangerConfig), isMandatory: false },
{ ruleResult: rules_1.checkRequestedReviewers(dangerConfig), isMandatory: false },
{ ruleResult: rules_1.checkTicketLinkInPrBoby(dangerConfig), isMandatory: true },
{ ruleResult: rules_1.checkUpdatedTests(dangerConfig), isMandatory: false },
{ ruleResult: rules_1.checkApprovals(dangerConfig), isMandatory: true }
];
const mandatoryRules = rules.filter(({ isMandatory }) => isMandatory);
const isAFlawlessCode = mandatoryRules.every(({ ruleResult }) => ruleResult);
if (isAFlawlessCode) {
rules_1.checkFlawlessCode(dangerConfig);
}
return isAFlawlessCode;
};
exports.checkPullRequest = checkPullRequest;
;