Skip to main content

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.

This is on PyPI as pylint-sarif-unofficial.

This uses python-jsonschema-objects, which does not currently support version 4.18 of jsonschema. To avoid holding your project's jsonschema version (if it uses it) back, I suggest installing pylint-sarif-unofficial using pipx instead of listing it in your project's manifest file. You can put a command like this in your pylint CI workflow:

pipx install pylint-sarif-unofficial

Or with the specific version you want, for example:

pipx install pylint-sarif-unofficial==0.2.1

Your project can still install pylint itself as a development dependency.

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.

Metadata

Release files for pylint-sarif-unofficial 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylint-sarif-unofficial 0.2.1
File Size Uploaded Provenance
pylint_sarif_unofficial-0.2.1.tar.gz 23.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pylint-sarif-unofficial 0.2.1
File Interpreter ABI Platform
pylint_sarif_unofficial-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 48.0 kB

Release files / pylint_sarif_unofficial-0.2.1.tar.gz

Download URL pylint_sarif_unofficial-0.2.1.tar.gz
Size 23.7 kB
Tags Source
SHA-256 checksum
How to use checksums
73f4354b881af810192c07cdb1b238165b4fbf0c27645c4969c8cbf68faa1249
BLAKE2b-256 checksum
How to use checksums
56a4464536c02dc4ba4d4b454db1e74af3c82a7262899eef5a7dbe587e212111
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.90.1-microsoft-standard-WSL2

Release files / pylint_sarif_unofficial-0.2.1-py3-none-any.whl

Download URL pylint_sarif_unofficial-0.2.1-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82ef7952aacf275ee43b3bb675eda8a15d68c214d7f35af521424f8535159a59
BLAKE2b-256 checksum
How to use checksums
5ebed3a61b203913b020c9a26230530c58ed487601f048161b83769e0b8b209b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.90.1-microsoft-standard-WSL2

Security for pylint-sarif-unofficial 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page