Skip to main content

Pylint output as SARIF

Project description

This is an unofficial fork of the pylint-sarif project. Most code here was written by the original GrammaTech developers, but they are not responsible for any bugs.

The LICENSE is the same as in the upstream project. The original project readme follows below.

pylint-sarif

This repo contains code for converting from Pylint output to SARIF, and for invoking CodeSonar in a manner that does a analysis and imports the SARIF file.

The version of SARIF supported is the one specified by the version in sarif-spec.json. This is a snapshot taken from here: https://github.com/Microsoft/sarif-sdk/blob/develop/src/Sarif/Schemata/sarif-schema.json

Note that the version string included therein identifies the particular draft of the SARIF specification.

pylint2sarif.py

This runs pylint and converts the output to SARIF v2.

To use:

python pylint2sarif.py --help

Typically, you give it the exact same set of arguments that you would pass to pylint. E.g.,

python pylint2sarif.py ex1.py

pylint2cso.py

This runs CodeSonar to create an analysis and import the SARIF file.

python pylint2cso.py -h

Sample invocation:

codesonar analyze -preset sarif_import Proj localhost:9460 python pylint2cso.py ex.py

Note that this must be run under CodeSonar in this fashion or it will just not work.

Requirements

pylint2sarif.py needs the following:

  • Python 2 or 3, but note that Cygwin python is NOT supported

  • pip install python_jsonschema_objects. This has been tested for release 0.3.12, which corresponds to version 0.0.18

  • pip install pylint

pylint2cso.py needs:

  • A version of CodeSonar supporting the importing of SARIF v2.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylint_sarif_unofficial-0.1.0.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

pylint_sarif_unofficial-0.1.0-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file pylint_sarif_unofficial-0.1.0.tar.gz.

File metadata

  • Download URL: pylint_sarif_unofficial-0.1.0.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.4 Linux/5.4.0-1105-azure

File hashes

Hashes for pylint_sarif_unofficial-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fe8a2dd70c5d46346c2de64233ed815bb2252fcb7e2a81dc0c9a2a336e76115e
MD5 4378a1b6ce93b917488cbe309f4a6334
BLAKE2b-256 8439a846cc8b4574c4e44274c9ccbe4a7bdd9160e4b3706e83e63191f24f263e

See more details on using hashes here.

File details

Details for the file pylint_sarif_unofficial-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pylint_sarif_unofficial-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 967d89e94641027deb364339068222a4dc811cd11e47276298071443a97f621f
MD5 2417360a63192bdf1479f773b6734730
BLAKE2b-256 5563134b629c8496f30d6a91d27c5334cd7db405f5d465a550b549cf09732330

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page