1.1.4 • Published 1 year ago

sarif-junit v1.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

This project aims to convert a SARIF output file from a linter to a JUnit XML output file. It could be used inside GitLab to show which tests are failing in the CI/CD pipeline. It was created to be used in the mega_linter job hosted on r2devops.io.

Installation

# npm
npm install -g sarif-junit@latest

# yarn
yarn global add sarif-junit@latest

You can update latest tag by a specific version tag

Usage

You can use this tool in two ways:

1. Using the CLI

sarif-junit --input <input-file> --output <output-file>
[--test-suite <test-suite>] 

👉 You can also use the short version of the arguments -i and -o.

2. Importing the module in your code

Here is an example of how to read a SARIF file and convert it to a CodeClimate file:

const saver = require('sarif-junit/lib/saver');
const fs = require('fs');

//Read the input file
let input_sarif_file = null
try {
  input_sarif_file = fs.readFileSync("result.sarif", 'utf8');
} catch (e) {
  console.log(e.message);
}
saver(input_sarif_file, "result.xml", "testSuite");

Contributing

Are you missing something or want to contribute? Feel free to open an issue or create a pull request

License

MIT

Author

GridexX, a french DevOps working for R2DevOps; with help of nvuillam

1.1.4

1 year ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago