danger-plugin-lint-report
This plugin reads checkstyle / lint reports and posts issues and violations as inline comments in pull requests.
Screenshot of an issue posted as inline comment in a GitHub pull request:
Requirements
The plugin does not execute any linter.
Instead, the plugin will search the file tree for lint reports according to the specified file mask and parse them.
The plugin requires a configuration object with a file mask to search for XML reports.
Supported Reports
If you encounter a format that is missing, feel free to add a pull request or open an issue with a sample report attached.
- Checkstyle 4.3
- Checkstyle 8.0
- Android Lint (Format 5)
Usage
Install:
yarn add danger-plugin-lint-report --dev
At a glance:
import { schedule } from 'danger'
const reporter = require("danger-plugin-lint-report")
schedule(reporter.scan({
fileMask: "**/reports/lint-results.xml",
reportSeverity: true,
requireLineModification: true,
}))
Configuration:
interface CheckstyleConfig {
fileMask: string
reportSeverity: boolean
requireLineModification: boolean
outputPrefix?: string
violationFormatter?: ViolationFormatter
removeDuplicates?: boolean
}
Changelog
See the GitHub release history.
Contributing
See CONTRIBUTING.md.