ci: add clang-format and MISRA static-analysis checks #38

Closed
opened 2026-07-22 10:19:13 +00:00 by hoogv · 0 comments
hoogv commented 2026-07-22 10:19:13 +00:00 (Migrated from codeberg.org)

Description

.forgejo/workflows/tests.yml currently only runs the host-native Catch2 test suite. Two more static-quality gates should run on every push/PR: a .clang-format conformance check (the config already exists, added under feat(c-lint), but nothing enforces it yet), and a MISRA C static-analysis pass using tools/misra/run_misra.sh's existing cppcheck-based tooling (currently only exists in a local backup, not committed).

Scope

  • Land tools/misra/run_misra.sh, tools/misra/suppressions.txt, and tools/misra/generate_rule_texts.py (the generated rule_texts.txt/misra.json/report.txt stay gitignored, never committed -- MISRA's guideline text is copyrighted)
  • run_misra.sh only targets directories that actually exist on disk (hal/mss/hal/dss aren't landed yet, only hal/util and hal/registers are) so it doesn't hard-fail before the driver tree lands
  • Add a CI job that runs clang-format --dry-run --Werror over files changed in the current push/PR (not the whole tree -- the existing register headers predate .clang-format and aren't conformant yet; reformatting them is out of scope here)
  • Add a CI job that runs the MISRA cppcheck pass, sourcing the copyrighted rule text from a MISRA_RULES repo secret (already added) instead of a locally-purchased PDF, applying tools/misra/suppressions.txt, and failing on any unsuppressed finding

Functional Impact

None -- CI/build-tooling only, no product/driver code changes.

Regulatory Impact

None

QMS Impact

Potential -- adds a new automated static-analysis gate; may be relevant to QMS tooling records.

Risk Impact

No -- existing risk coverage sufficient.

Relates to #16

### Description `.forgejo/workflows/tests.yml` currently only runs the host-native Catch2 test suite. Two more static-quality gates should run on every push/PR: a `.clang-format` conformance check (the config already exists, added under `feat(c-lint)`, but nothing enforces it yet), and a MISRA C static-analysis pass using `tools/misra/run_misra.sh`'s existing cppcheck-based tooling (currently only exists in a local backup, not committed). ### Scope - [x] Land `tools/misra/run_misra.sh`, `tools/misra/suppressions.txt`, and `tools/misra/generate_rule_texts.py` (the generated `rule_texts.txt`/`misra.json`/`report.txt` stay gitignored, never committed -- MISRA's guideline text is copyrighted) - [x] `run_misra.sh` only targets directories that actually exist on disk (`hal/mss`/`hal/dss` aren't landed yet, only `hal/util` and `hal/registers` are) so it doesn't hard-fail before the driver tree lands - [x] Add a CI job that runs `clang-format --dry-run --Werror` over files *changed in the current push/PR* (not the whole tree -- the existing register headers predate `.clang-format` and aren't conformant yet; reformatting them is out of scope here) - [x] Add a CI job that runs the MISRA cppcheck pass, sourcing the copyrighted rule text from a `MISRA_RULES` repo secret (already added) instead of a locally-purchased PDF, applying `tools/misra/suppressions.txt`, and failing on any unsuppressed finding ### Functional Impact None -- CI/build-tooling only, no product/driver code changes. ### Regulatory Impact None ### QMS Impact Potential -- adds a new automated static-analysis gate; may be relevant to QMS tooling records. ### Risk Impact No -- existing risk coverage sufficient. ### Related Issues / PRs Relates to #16
hoogv self-assigned this 2026-07-23 12:02:09 +00:00
hoogv added this to the Development project 2026-07-23 12:02:11 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
opendutchsolutions.public/hal_awr6843#38
No description provided.