ci(lint): add clang-format and MISRA static-analysis checks #39
No reviewers
Labels
No labels
Category
App
Category
Documentation
Category
Firmware
Category
Hardware
Category
Qms
PR_Size
L
PR_Size
M
PR_Size
S
PR_Size
XL
PR_Size
XS
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Priority
Very Low Priority
Size
Epic
Size
Feature
Size
Task
Status
Blocked
Status
Draft
Status
Needs-review
Team
Board
Team
Dev
Team
Management
Type
Bug
Type
Capa
Type
Improvement
Type
New-feature
Type
Regulatory
Type
Usability
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
opendutchsolutions.public/hal_awr6843!39
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/39/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Adds
.forgejo/workflows/lint.ymlwith two CI jobs: a.clang-formatconformance check on changed files, and a MISRA C static-analysis pass usingtools/misra/run_misra.sh's cppcheck-based tooling.Why
Change justification per ISO 9001 section 7.5.2:
.forgejo/workflows/tests.ymlcurrently only runs the host-native Catch2 test suite — no static-quality gate enforces.clang-formatconformance or MISRA C compliance on every push/PR, both of which are QMS-relevant for this MISRA-governed firmware project.Related Issue
Closes #38
Type of Change
Impact Assessment
Testing
run_misra.shruns clean (0 findings) againsthal/utilwith a valid syntheticrule_texts.txt; confirmed it still catches a real violation (injected agotostatement, an unsuppressed rule); confirmed the crash-detection fix actually fires on a malformed rule-texts file; confirmed the clang-format changed-files diff logic correctly picks up.c/.hfiles from a real past commit and thatclang-format --dry-run --Werrorcorrectly flags non-conformant code.PR Size
Size justification / exemption:
Raw diff is 459 lines across 4 new files.
Exemption
This PR restores previously-existing tooling from a local backup rather than authoring new business logic from scratch:
tools/misra/run_misra.sh(134 lines) andtools/misra/generate_rule_texts.py(107 lines) are infrastructure scripts, andtools/misra/suppressions.txt(144 lines) is a mostly-mechanical list of pre-vetted rule suppressions. Only.forgejo/workflows/lint.yml(74 lines) is genuinely new CI wiring. Not split further since these four files are one cohesive, interdependent unit (the workflow invokes the script, which reads the suppressions file and is generated by the Python script) that doesn't functively separate into smaller independently-reviewable PRs.Checklist
type(scope): descriptionconvention withRelates to #<issue>footerSummary
.clang-formatconfig, not the whole tree — the existing register headers predate that config and aren't conformant yet, so a whole-tree gate would fail immediately on landing.tools/misra/run_misra.sh's cppcheck-based MISRA C pass. MISRA's guideline text is copyrighted, sorule_texts.txtis populated from theMISRA_RULESrepo secret at run time instead of a locally-purchased PDF;rule_texts.txt/misra.json/report.txtstay gitignored, never committed.tools/misra/{run_misra.sh,suppressions.txt,generate_rule_texts.py}(previously only in a local backup, never committed).run_misra.shhardcodedhal/mss/hal/dssas check targets, but neither is landed yet — changed to check whatever subset of{mss,dss,util}actually exists on disk. A crashedmisra.pyaddon makes cppcheck bail out with an[internalError], which the report-generationgrepdidn't match — silently producing a false "0 findings" clean pass instead of a failure; added a check that fails loudly on that bailout message.misra-c2012-17.3(implicit function declaration) fires onmmwhal_types.h's GCC inline-asm critical-section macros (__asm__ __volatile__(...)) becausemisra.pydoesn't recognize__asm__as a keyword.