static code analyzer tool for Clang with compilation database support.
Project description
clanganalyzer
A package designed to run the clang static analyzer against projects with existing compilation databases. The clanganalyzer tool runs the clang static analyzer against a compilation database.
How to get
It’s available from the Python Package Index and can be installed using pip or uv:
$ pip install scan-build
Or using uv (recommended):
$ uv add scan-build
For development:
$ uv sync --all-extras
Portability
Should be working on UNIX operating systems.
It has been tested on FreeBSD, GNU/Linux, OS X and Windows.
Prerequisites
clang compiler, to compile the sources and have the static analyzer.
python interpreter (version 3.10 or later). Supported versions: 3.10, 3.11, 3.12, 3.13.
How to use
To run the Clang static analyzer against a project with an existing compilation database goes like this:
$ clanganalyzer
Use --help to know more about the command.
Prerequisites
The clanganalyzer tool requires:
An existing compilation database (compile_commands.json) for your project
The clang static analyzer to be available on your system
You can generate a compilation database using various tools like CMake (with -DCMAKE_EXPORT_COMPILE_COMMANDS=ON), Bear, or other build systems that support compilation database generation.
Known problems
The tool requires a valid compilation database to function. If your project doesn’t have one, you’ll need to generate it first using your build system or tools like Bear.
Development
To set up a development environment:
$ git clone https://github.com/rizsotto/scan-build.git $ cd scan-build $ uv sync --all-extras
To run tests:
$ uv run pytest tests/unit $ uv run lit -v tests/functional
To run linting and type checking:
$ uv run ruff check . $ uv run ruff format . $ uv run ty clanganalyzer
Problem reports
If you find a bug in this documentation or elsewhere in the program or would like to propose an improvement, please use the project’s issue tracker. Please describe the bug and where you found it. If you have a suggestion how to fix it, include that as well. Patches are also welcome.
License
The project is licensed under University of Illinois/NCSA Open Source License. See LICENSE.TXT for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scan_build-3.0.0.tar.gz.
File metadata
- Download URL: scan_build-3.0.0.tar.gz
- Upload date:
- Size: 43.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
499d1a99051680b919495c632ca692c9d09793660ed20aaeafc69c1451179b2e
|
|
| MD5 |
d1e602277505c5cc8b98e5036b3abbb6
|
|
| BLAKE2b-256 |
b90c3c44347b6f23b2012e1e8f42aa4b49086d0f67d22ac445305de01116505d
|
Provenance
The following attestation bundles were made for scan_build-3.0.0.tar.gz:
Publisher:
python-publish.yml on rizsotto/scan-build
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scan_build-3.0.0.tar.gz -
Subject digest:
499d1a99051680b919495c632ca692c9d09793660ed20aaeafc69c1451179b2e - Sigstore transparency entry: 991519463
- Sigstore integration time:
-
Permalink:
rizsotto/scan-build@15f06358b3e90f2ff0b8e9a4ac58319e68691f61 -
Branch / Tag:
refs/tags/3.0.0 - Owner: https://github.com/rizsotto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@15f06358b3e90f2ff0b8e9a4ac58319e68691f61 -
Trigger Event:
release
-
Statement type:
File details
Details for the file scan_build-3.0.0-py3-none-any.whl.
File metadata
- Download URL: scan_build-3.0.0-py3-none-any.whl
- Upload date:
- Size: 32.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d16e89b37413223f53fea81fc4f008135c63f15e255af1fcf3f6bc8297ab054b
|
|
| MD5 |
2956b2b2846ef4255aee1209365c05b2
|
|
| BLAKE2b-256 |
c99d0684d682e2ad347e3e68a78b6526b1dbb8bd41d036d95337751cabfec354
|
Provenance
The following attestation bundles were made for scan_build-3.0.0-py3-none-any.whl:
Publisher:
python-publish.yml on rizsotto/scan-build
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scan_build-3.0.0-py3-none-any.whl -
Subject digest:
d16e89b37413223f53fea81fc4f008135c63f15e255af1fcf3f6bc8297ab054b - Sigstore transparency entry: 991519465
- Sigstore integration time:
-
Permalink:
rizsotto/scan-build@15f06358b3e90f2ff0b8e9a4ac58319e68691f61 -
Branch / Tag:
refs/tags/3.0.0 - Owner: https://github.com/rizsotto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@15f06358b3e90f2ff0b8e9a4ac58319e68691f61 -
Trigger Event:
release
-
Statement type: