# violation-reporter

> Genrate violation reports in various formats

Latest version **0.0.3** (published 2016-06-08) · 0 weekly downloads

## Install

```sh
npm install violation-reporter
pnpm add violation-reporter
yarn add violation-reporter
bun add violation-reporter
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2016-06-08 |
| First published | 2016-05-04 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Stuart Campbell |
| Maintainers | campbes |

## Links

- npm: https://www.npmjs.com/package/violation-reporter
- Repository: https://github.com/campbes/violation-reporter
- Homepage: https://github.com/campbes/violation-reporter#readme
- Issues: https://github.com/campbes/violation-reporter/issues
- npm.io page: https://npm.io/package/violation-reporter

## Dependencies (1)

- [fs-extra](https://npm.io/package/fs-extra.md) ^0.23.0

## Recent versions

- 0.0.3 (latest) — 2016-06-08
- 0.0.2 — 2016-05-10
- 0.0.1 — 2016-05-06
- 0.0.0-beta.1 — 2016-05-06
- 0.0.0-alpha.3 — 2016-05-06
- 0.0.0-alpha.2 — 2016-05-06
- 0.0.0-alpha.1 — 2016-05-04

## README

## Synopsis

Generate a generic violation report from whatever tool you like and optionally generate a standard XML report.

## Code Example

    var MultiReporter = require('violation-reporter')(grunt);
    var XMLReporter = require('violation-reporter/tasks/XML')(grunt);
    var checkstyleReporter = require('violation-reporter/tasks/checkstyleXML')(grunt, XMLReporter);

    // create a new reporter and add checkstyle formatting
    var reporter = new MultiReporter(files, options);
    reporter.addReporter(checkstyleReporter);
    
    // create a new violation, from whatever data you like
    violations.push({
      filepath: file,
      line: 0,
      column: 0,
      name: key,
      rule: key,
      severity: severity,
      message: 'Too many',
      ratio: ratio,
      value: metrics[key] + ' ('+ options.analyzecss[key] + ')'
    });

    // register the violation with the reporter
    reporter.violations(file, violations); 
       

Real-world examples can be found in ([grunt-css-analysis](https://github.com/campbes/grunt-css-analysis)) and ([grunt-complexity-report](https://github.com/campbes/grunt-complexity-report))  
    

## Motivation

Jenkins has plugins to report on violations from a number of standard tools. There are many tools that are used to generate errors and issues, in a huge range of formats. 
Violation-reporter is designed as a way to take this data and transform it into one of the available standards.
Generally intended to be run from grunt or another build tool.

It currently only outputs to console, checkstyle and PMD format, but would be easy to extend to other XML formats.


## Installation

npm install violation-reporter

## Contributors

Stuart Campbell ([campbes](https://github.com/campbes))

## License

Released under the [MIT License](http://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/violation-reporter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
