Skip to main content

misch

CI PyPI Python License: MIT

Point misch at a C project and ratchet it toward MISRA C:2023. It is a configuration-driven harness around cppcheck and its misra.py addon. A compilation database describes the real build; misra.toml describes the analysis boundary and project policy.

  • Explicit scope: every compilation unit is analysed or deliberately excluded.
  • Baseline ratchet: existing findings remain visible while CI rejects new ones.
  • Deviation records: suppressions require justification and can be audited for staleness.
  • Bring-your-own rule texts: no copyrighted MISRA material is bundled.

misch is an adoption and guidance tool, not a compliance-certification tool. cppcheck's addon implements only a subset of MISRA C:2023 checks.

Install

Python 3.11 or later and cppcheck with its bundled misra.py addon are required. cppcheck must be available on PATH.

uv tool install misch

Alternatively, use pipx install misch or pip install misch. From a checkout, use uv sync and prefix commands with uv run.

Quick start

Run these commands from the root of the C project:

misch init --scaffold  # create misra.toml and a documented analysis/ tree
misch run              # report findings; exit 1 when findings are present
misch baseline         # explicitly accept the current finding counts
misch run --baseline   # report everything; exit 1 only for new findings
misch deviations       # validate suppressions and their justifications

Use misch init without --scaffold when only a configuration file is wanted. Review the generated scope, exclusions, and compilation-database source before the first run.

Rule headlines and Mandatory, Required, or Advisory categories are optional. Supply them from a licensed MISRA document through a cppcheck-format file:

export MISRA_RULE_TEXTS=/secure/path/misra-headlines.txt

Analysis still runs without that file and labels categories as unknown. See Rule texts for format and licensing guidance.

Commands

Command Purpose
misch init Generate a documented misra.toml; add --scaffold for the recommended analysis asset tree.
misch run Analyse and render terminal, JSON, or SARIF results. Add --baseline to fail only on findings above accepted counts.
misch baseline Analyse and store the current finding counts as the accepted baseline.
misch deviations Validate inline and project suppressions; optionally emit a Markdown deviation record or check staleness.

Run misch COMMAND --help for command options.

Exit codes are format-independent:

  • 0: clean, no new baseline findings, or valid deviations;
  • 1: findings, new baseline findings, or invalid deviations;
  • 2: configuration, scope, compilation-database, initialization, or engine error.

Configuration

misch reads misra.toml from the current working directory unless -c PATH is supplied. It does not search parent directories. Relative configuration paths are resolved from the selected file's directory.

A minimal configuration looks like this:

[project]
scope = ["src/", "include/"]
exclude = ["tests/", "vendor/"]

[db]
source = "existing"
path = "build/compile_commands.json"

[platform]
preset = "unix64"

[rules]
texts = "${MISRA_RULE_TEXTS}"

For a multi-platform project, put platform-specific overrides under a profile and select it for analysis:

misch run --profile aarch64

--profile selects a configuration overlay that already exists in the file; it does not set a cppcheck platform directly. Give each ratcheted profile its own baseline.path, since findings differ between platforms.

See the Configuration reference for all sections, including profile overlays, path rules, report formats, baselines, deviations, and initialization behavior.

Scaffold layout

misch init --scaffold creates:

project-root/
├── misra.toml
└── analysis/
    ├── README.md
    ├── rules/README.md
    ├── deviations/misra-deviations.txt
    └── baseline/README.md

The configuration points at the deviations template and the future baseline path. Initialization creates neither licensed rule text nor a baseline acceptance file. If any generated target already exists, the command writes nothing unless --force is supplied; --force replaces every generated regular file.

Documentation

License

misch is distributed under the MIT License. It contains no MISRA guideline text; users must source and handle any rule-text file according to their own licence.

Metadata

Release files for misch 0.3.0

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

Source distribution (sdist)

Source distribution for misch 0.3.0
File Size Uploaded Provenance Actions
misch-0.3.0.tar.gz 67.3 kB With provenance Details for misch-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for misch 0.3.0
File Interpreter ABI Platform Actions
misch-0.3.0-py3-none-any.whl Python 3 none any Details for misch-0.3.0-py3-none-any.whl

Total release size: 102.4 kB

Release files / misch-0.3.0.tar.gz

Download URL misch-0.3.0.tar.gz
Size 67.3 kB
Tags Source
SHA-256 checksum
How to use checksums
522d9ab2ef4727d258442226d386adc5e3a111d884e0a1bf4262c44ac27511a0
BLAKE2b-256 checksum
How to use checksums
927da0f8aab7df17fabe930795435196206371cd003c08cfd59f45fff249a596
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

Release files / misch-0.3.0-py3-none-any.whl

Download URL misch-0.3.0-py3-none-any.whl
Size 35.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8fe98e975ac151d9cbb0a8e3236bb7b5ec9730b44385f5c919e839e0b7361cd4
BLAKE2b-256 checksum
How to use checksums
f503603796cd2430cd6279588b3f52599997ef5b4431b3fc51d35d655cec23d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

Security for misch 0.3.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for misch-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

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