🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

sarif-codeclimate

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sarif-codeclimate

Convert your SARIF output into a readable JSON compatible with GitLab Code Climate Tool

2.1.2
latest
Source
npm
Version published
Weekly downloads
6K
-0.12%
Maintainers
3
Weekly downloads
 
Created
Source



Sarif-CodeClimate

This project aims to convert a SARIF output file from a linter to a CodeClimate output file. It could be use inside GitLab to display to the user the result of the linter inside the MR. It was first created to be used in the mega_linter job hosted on r2devops.io.

Installation

# npm
npm i -g sarif-codeclimate@latest

# yarn 
yarn global add sarif-codeclimate@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-codeclimate --input <path to sarif file> --output <path to codeclimate file>

👉 You can also use the short version of the arguments -i and -o. Output file is optional, if you don't specify it, the output will be printed in the console.

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 { convert } = require('sarif-codeclimate/out/lib/converter');
const fs = require('fs');
const {
  parseResult: {
    data,
  }
} = convert("megalinter-report.sarif");
fs.writeFileSync('codeclimate-result.json', JSON.stringify(data, null, 4));


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.

Keywords

sarif

FAQs

Package last updated on 03 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts