**This is [an unofficial fork](https://github.com/EliahKagan/pylint-sarif) of
[the `pylint-sarif` project](https://github.com/GrammaTech/pylint-sarif).** 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`](https://pypi.org/project/pylint-sarif-unofficial/).
This uses
[python-jsonschema-objects](http://python-jsonschema-objects.readthedocs.org/),
which [does not currently
support](https://github.com/cwacek/python-jsonschema-objects/issues/235)
version 4.18 of [jsonschema](https://github.com/python-jsonschema/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:
```bash
pipx install pylint-sarif-unofficial
```
Or with the specific version you want, for example:
```bash
pipx install pylint-sarif-unofficial==0.2.1
```
Your project can still install `pylint` itself as a development dependency.
The [`LICENSE`](https://github.com/EliahKagan/pylint-sarif/blob/develop/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.
Raw data
{
"_id": null,
"home_page": "https://github.com/EliahKagan/pylint-sarif",
"name": "pylint-sarif-unofficial",
"maintainer": "Eliah Kagan",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "degeneracypressure@gmail.com",
"keywords": "pylint,sarif",
"author": "",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/56/a4/464536c02dc4ba4d4b454db1e74af3c82a7262899eef5a7dbe587e212111/pylint_sarif_unofficial-0.2.1.tar.gz",
"platform": null,
"description": "**This is [an unofficial fork](https://github.com/EliahKagan/pylint-sarif) of\n[the `pylint-sarif` project](https://github.com/GrammaTech/pylint-sarif).** Most\ncode here was written by the original GrammaTech developers, but they are not\nresponsible for any bugs.\n\nThis is on PyPI as\n[`pylint-sarif-unofficial`](https://pypi.org/project/pylint-sarif-unofficial/).\n\nThis uses\n[python-jsonschema-objects](http://python-jsonschema-objects.readthedocs.org/),\nwhich [does not currently\nsupport](https://github.com/cwacek/python-jsonschema-objects/issues/235)\nversion 4.18 of [jsonschema](https://github.com/python-jsonschema/jsonschema).\nTo avoid holding your project's `jsonschema` version (if it uses it) back, I\nsuggest installing `pylint-sarif-unofficial` using `pipx` instead of listing it\nin your project's manifest file. You can put a command like this in your pylint\nCI workflow:\n\n```bash\npipx install pylint-sarif-unofficial\n```\n\nOr with the specific version you want, for example:\n\n```bash\npipx install pylint-sarif-unofficial==0.2.1\n```\n\nYour project can still install `pylint` itself as a development dependency.\n\nThe [`LICENSE`](https://github.com/EliahKagan/pylint-sarif/blob/develop/LICENSE)\nis the same as in the upstream project. The original project readme follows\nbelow.\n\n# pylint-sarif\n\nThis repo contains code for converting from Pylint output to SARIF, and for\ninvoking CodeSonar in a manner that does a analysis and imports the SARIF file.\n\nThe version of SARIF supported is the one specified by the version\nin sarif-spec.json. This is a snapshot taken from here:\nhttps://github.com/Microsoft/sarif-sdk/blob/develop/src/Sarif/Schemata/sarif-schema.json\n\nNote that the version string included therein identifies the particular draft of\nthe SARIF specification.\n\n## pylint2sarif.py\n\nThis runs pylint and converts the output to SARIF v2.\n\nTo use:\n```\npython pylint2sarif.py --help\n```\n\nTypically, you give it the exact same set of arguments that you would pass to pylint. E.g.,\n\n```\npython pylint2sarif.py ex1.py\n```\n\n## pylint2cso.py\n\nThis runs CodeSonar to create an analysis and import the SARIF file.\n\n```\npython pylint2cso.py -h\n```\n\nSample invocation:\n\n```\ncodesonar analyze -preset sarif_import Proj localhost:9460 python pylint2cso.py ex.py\n```\n\nNote that this must be run under CodeSonar in this fashion or it will just not work.\n\n\n## Requirements\n`pylint2sarif.py` needs the following:\n* Python 2 or 3, but note that Cygwin python is NOT supported\n* pip install python_jsonschema_objects. This has been tested for release 0.3.12, which corresponds to version 0.0.18\n\n* pip install pylint\n\n`pylint2cso.py` needs:\n* A version of CodeSonar supporting the importing of SARIF v2.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Pylint output as SARIF",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://github.com/EliahKagan/pylint-sarif",
"Repository": "https://github.com/EliahKagan/pylint-sarif"
},
"split_keywords": [
"pylint",
"sarif"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5ebed3a61b203913b020c9a26230530c58ed487601f048161b83769e0b8b209b",
"md5": "196b202df3b9cb758c9e7495ba35bffe",
"sha256": "82ef7952aacf275ee43b3bb675eda8a15d68c214d7f35af521424f8535159a59"
},
"downloads": -1,
"filename": "pylint_sarif_unofficial-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "196b202df3b9cb758c9e7495ba35bffe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 24363,
"upload_time": "2023-08-07T04:07:04",
"upload_time_iso_8601": "2023-08-07T04:07:04.218857Z",
"url": "https://files.pythonhosted.org/packages/5e/be/d3a61b203913b020c9a26230530c58ed487601f048161b83769e0b8b209b/pylint_sarif_unofficial-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "56a4464536c02dc4ba4d4b454db1e74af3c82a7262899eef5a7dbe587e212111",
"md5": "696db33c8131b6adb95404b7bf454598",
"sha256": "73f4354b881af810192c07cdb1b238165b4fbf0c27645c4969c8cbf68faa1249"
},
"downloads": -1,
"filename": "pylint_sarif_unofficial-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "696db33c8131b6adb95404b7bf454598",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 23657,
"upload_time": "2023-08-07T04:07:05",
"upload_time_iso_8601": "2023-08-07T04:07:05.790185Z",
"url": "https://files.pythonhosted.org/packages/56/a4/464536c02dc4ba4d4b454db1e74af3c82a7262899eef5a7dbe587e212111/pylint_sarif_unofficial-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-07 04:07:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "EliahKagan",
"github_project": "pylint-sarif",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pylint-sarif-unofficial"
}