UNPKG

danger-plugin-lint-report

Version:

This plugin reads checkstyle / lint reports and posts issues and violations as inline comments in pull requests.

18 lines (17 loc) 714 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.reportViolationsForLines = void 0; function reportViolationsForLines(violations, fileDiffs, requireLineModification, violationCallback) { // we got all changed lines in fileDiffs (file => list of line) violations.forEach(violation => { const file = violation.file; const line = violation.line; const diff = fileDiffs.find(element => element.file === file); if (diff) { if (!requireLineModification || diff.added_lines.includes(line)) { violationCallback(violation); } } }); } exports.reportViolationsForLines = reportViolationsForLines;