Skip to content

ci: S24.11 extend analyze-tidy + analyze-iwyu to platform code#460

Merged
DavidCozens merged 12 commits into
mainfrom
ci/s24-11-extend-analyzer-coverage
May 26, 2026
Merged

ci: S24.11 extend analyze-tidy + analyze-iwyu to platform code#460
DavidCozens merged 12 commits into
mainfrom
ci/s24-11-extend-analyzer-coverage

Conversation

@DavidCozens

@DavidCozens DavidCozens commented May 26, 2026

Copy link
Copy Markdown
Owner

Purpose

Closes #459. Extends the CMake-driven analyzer jobs (analyze-tidy, analyze-iwyu) to cover the FreeRTOS / PlusTcp / MbedTls / FatFs / LwipRaw platform trees and their tests, which the base-image lanes silently skipped because FREERTOS_KERNEL_PATH / MBEDTLS_DIR / LWIP_PATH / FATFS_PATH aren't set in cpputest:sha-*. analyze-cppcheck (and the cppcheck-misra step) already covered those trees via direct invocation — no change needed there.

Also brings forward scripts/misra_renumber.py (originally a closing deliverable) when the IWYU apply line-shifted some MISRA suppressions, and docs/local-checks.md codifying the tiered pre-PR check budget agreed at session start.

Change Description

CI lanes (the literal #459 scope)

  • New analyze-tidy-freertos-plustcp and analyze-iwyu-freertos-plustcp on cpputest-freertos:sha-a0c1c0a — env vars are set, so Platform/{FreeRtos,PlusTcp,LwipRaw,MbedTls,FatFs} and their Tests/* siblings enter the CMake configure.
  • The freertos IWYU lane spells -DCMAKE_C_COMPILER=clang-19 explicitly: the cpputest gcc base ships clang-19 but no clang alternative. A future image bump can drop the override.
  • LWIP analyzer coverage deferred to S28.06 (when the lwIP backend is feature-complete) — only PLUSTCP is wired today.

Image bumps (cascade through the chain)

  • ghcr.io/davidcozens/cpputest: sha-18f19e1sha-2c7b76b — adds include-what-you-use 0.23 built from the clang_19 upstream branch (same recipe cpputest-clang already used) so all three images ship the same IWYU binary.
  • ghcr.io/davidcozens/cpputest-freertos: sha-24de138sha-a0c1c0a — inherits IWYU automatically via FROM cpputest.
  • ghcr.io/davidcozens/cpputest-freertos-cross: sha-24de138sha-a0c1c0a — inherits via chain.

Image work landed via CppUTestDocker#2 and CppUTestFreertosDocker#4.

IWYU filter hardening (scripts/iwyu_filter.py)

Three new filter rules so the freertos-aware lane settles cleanly:

  • Drop whole-file blocks under /opt/* — third-party trees IWYU shouldn't be suggesting include changes for.
  • Drop removals of FreeRTOS.h and FreeRTOS_IP.h — both are umbrella headers that must be included first to set up the build environment from FreeRTOSConfig.h before any FreeRTOS sub-header is parsed. IWYU sees specific types in task.h / portmacro.h / FreeRTOS_DNS_Globals.h and decides the umbrella is redundant, but removing it breaks the upstream convention.
  • Drop additions of FreeRTOSConfig.h (LayerGuard violation), portmacro.h (private FreeRTOS header), and FreeRTOS_DNS_Globals.h (internal _Globals suffix) — all are reached transitively through the umbrellas.

IWYU applied to 31 project-tree files

After the filter rules, ran cmake --build --preset iwyu --target iwyu-apply against the freertos image. Edits across Platform/{FreeRtos,PlusTcp,LwipRaw}/Source/, Tests/{FreeRtos,Lwip,MbedTls,MbedTlsIntegration}/, and Tests/Support/ fakes. Verified via a full cmake --preset debug && cmake --build --target junit BddTargetTests inside cpputest-freertos:sha-a0c1c0a — all tests pass.

Tidy treatment

  • Tests/.clang-tidy — adds tier-wide -bugprone-easily-swappable-parameters (rule fires too often for legitimate MMIO-helper / equality-assertion patterns; real arg-swap bugs in tests get caught by the test itself).
  • Tests/FreeRtos/CmsdkUartFake.c — NOLINTBEGIN/END around the CMSDK register-offset and status-bit macros (cppcoreguidelines-macro-to-enum, modernize-macro-to-enum); the #define form mirrors the ARM datasheet by design.
  • Bdd/Targets/FreeRtos/Common/CmsdkUart.c — same NOLINTBEGIN/END pattern for the production driver counterpart.
  • Platform/MbedTls/.clang-tidy (new) — extends StructIgnoredRegexp to accept upstream mbedtls_[a-z0-9_]+ struct names in forward declarations. Renaming is impossible (they're third-party). clang-tidy CheckOption values don't merge across the hierarchy, so the override file restates the root whitelist verbatim plus the mbedTLS namespace.

David's preference for tier-wide over inline surfaced mid-session; the inline NOLINTs in CmsdkUartFake.c stay as the consistent local pattern. A full audit of inline cppcheck-suppress / NOLINT* comments is queued under #461 — S24.12.

MISRA tooling: scripts/misra_renumber.py

Two-pass script that automates the clerical "renumber stale suppression lines after a refactor / IWYU shift":

  • Pass 1: cppcheck WITHOUT suppressions → audit (rule, file) pairs whose count matches but lines differ; remap ascending-by-ascending.
  • Pass 2: cppcheck WITH suppressions → catch per-location dedup shadowing (cppcheck reports only one rule per line, so a 11.3 hiding behind a 11.2 surfaces only with suppressions applied).

Conservative on ambiguity — bails on (rule, file) pairs whose suppression count and finding count diverge.

Used to fix the three line-shifts the IWYU apply introduced (PlusTcpAddress.c:9→10 for 11.2 and 11.3, PlusTcpDatagram.c:47→49 for 11.3).

Small fixes that came out of reading the cppcheck XML report whole

  • Platform/Windows/Source/SolidSyslogWindowsAtomicCounter.c — drop LONG previous = 0; initializer; the CAS loop unconditionally assigns it before any read. The finding had been sitting silently in cppcheck-report.xml across many CI runs (that step doesn't carry --error-exitcode=1).

Docs

  • docs/local-checks.md (new) — tiered pre-PR check budget: per-commit debug build + tests (~30–60s); pre-push IWYU + format + misra_renumber.py only when production source changed (~3–5 min); CI owns everything else. Path-gating is the engineer's judgement.
  • CLAUDE.md — "Before raising a PR" section now points at the doc rather than listing presets.
  • DEVLOG.md — session entry capturing decisions, deferrals, open questions.

Test Evidence

All seven analyzer / cppcheck lanes green on the final push:

  • analyze-tidy ✓ (Core + base-image Platforms)
  • analyze-tidy-freertos-plustcp ✓ (new — FreeRTOS / PlusTcp / LwipRaw / MbedTls / FatFs)
  • analyze-iwyu ✓ (Core + base-image Platforms, cpputest-clang)
  • analyze-iwyu-freertos-plustcp ✓ (new — freertos image, post iwyu-apply)
  • analyze-cppcheck ✓ (incl. cppcheck-misra with renumbered suppressions)
  • analyze-format
  • All build / test / sanitize / coverage / BDD / integration lanes ✓

Areas Affected

  • .github/workflows/ci.yml — 2 new jobs, image SHA bumps, summary.needs extended
  • .devcontainer/docker-compose.yml, ci/docker-compose.bdd.yml, docs/containers.md — image SHA bumps
  • Tests/.clang-tidy — tier-wide bugprone-easily-swappable-parameters relaxation
  • Platform/MbedTls/.clang-tidy (new) — mbedTLS struct-name exception
  • Tests/FreeRtos/CmsdkUartFake.c, Bdd/Targets/FreeRtos/Common/CmsdkUart.c — register-macro NOLINTBEGIN/END
  • Platform/Windows/Source/SolidSyslogWindowsAtomicCounter.c — drop dead initializer
  • 31 files under Platform/{FreeRtos,PlusTcp,LwipRaw}/Source/ + Tests/{FreeRtos,Lwip,MbedTls,MbedTlsIntegration}/ + Tests/Support — IWYU #include reorder / additions / removals
  • scripts/iwyu_filter.py — FreeRTOS-umbrella + /opt/* filter rules
  • scripts/misra_renumber.py (new)
  • misra_suppressions.txt — three line renumbers
  • docs/local-checks.md (new), CLAUDE.md, DEVLOG.md

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added FreeRTOS-aware code analysis jobs to CI pipeline (clang-tidy and include-what-you-use analysis).
  • Documentation

    • Added local development checks guide with streamlined pre-commit and pre-push workflows.
    • Updated container image documentation with latest base image information.
  • Chores

    • Updated Docker container images for CI and development environments.
    • Enhanced code analysis filtering for third-party dependencies.
    • Added automation tool for updating static analysis suppression markers.

Review Change Stack

cpputest now ships include-what-you-use 0.23 (clang_19), matching the
cpputest-clang build. cpputest-freertos and its cross sibling inherit
IWYU by chaining FROM the rebased base, enabling the freertos-aware
analyze-iwyu lane that subsequent commits on this branch add.

- ghcr.io/davidcozens/cpputest:           sha-18f19e1 -> sha-2c7b76b
- ghcr.io/davidcozens/cpputest-freertos:  sha-24de138 -> sha-a0c1c0a
- ghcr.io/davidcozens/cpputest-freertos-cross: sha-24de138 -> sha-a0c1c0a
@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fa7ab54f-5807-4fa4-98db-190ab09d495f

📥 Commits

Reviewing files that changed from the base of the PR and between 3a7b0a5 and e5689da.

📒 Files selected for processing (45)
  • .devcontainer/docker-compose.yml
  • .github/workflows/ci.yml
  • Bdd/Targets/FreeRtos/Common/CmsdkUart.c
  • CLAUDE.md
  • DEVLOG.md
  • Platform/LwipRaw/Source/SolidSyslogLwipRawResolver.c
  • Platform/MbedTls/.clang-tidy
  • Platform/PlusTcp/Source/SolidSyslogPlusTcpAddress.c
  • Platform/PlusTcp/Source/SolidSyslogPlusTcpDatagram.c
  • Platform/PlusTcp/Source/SolidSyslogPlusTcpTcpStream.c
  • Platform/Windows/Source/SolidSyslogWindowsAtomicCounter.c
  • Tests/.clang-tidy
  • Tests/FreeRtos/CmsdkUartFake.c
  • Tests/FreeRtos/CmsdkUartTest.cpp
  • Tests/FreeRtos/SolidSyslogFreeRtosMutexTest.cpp
  • Tests/FreeRtos/SolidSyslogFreeRtosSysUpTimeTest.cpp
  • Tests/FreeRtos/SolidSyslogPlusTcpAddressTest.cpp
  • Tests/FreeRtos/SolidSyslogPlusTcpDatagramTest.cpp
  • Tests/FreeRtos/SolidSyslogPlusTcpTcpStreamTest.cpp
  • Tests/Lwip/SolidSyslogLwipRawAddressTest.cpp
  • Tests/Lwip/SolidSyslogLwipRawResolverTest.cpp
  • Tests/MbedTls/SolidSyslogMbedTlsStreamTest.cpp
  • Tests/MbedTlsIntegration/MbedTlsTestCert.c
  • Tests/MbedTlsIntegration/MbedTlsTestServer.c
  • Tests/MbedTlsIntegration/SocketStream.c
  • Tests/MbedTlsIntegration/SolidSyslogMbedTlsStreamIntegrationTest.cpp
  • Tests/Support/FreeRtosFakes/Interface/FreeRTOSIPConfig.h
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosDnsFake.h
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosSemaphoreFake.h
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosSocketsFake.h
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosTaskFake.h
  • Tests/Support/FreeRtosFakes/Interface/portmacro.h
  • Tests/Support/FreeRtosFakes/Source/FreeRtosArpFake.c
  • Tests/Support/FreeRtosFakes/Source/FreeRtosDnsFake.c
  • Tests/Support/FreeRtosFakes/Source/FreeRtosSemaphoreFake.c
  • Tests/Support/FreeRtosFakes/Source/FreeRtosSocketsFake.c
  • Tests/Support/FreeRtosFakes/Source/FreeRtosTaskFake.c
  • Tests/Support/LwipFakes/Interface/arch/cc.h
  • Tests/Support/MbedTlsFake.c
  • ci/docker-compose.bdd.yml
  • docs/containers.md
  • docs/local-checks.md
  • misra_suppressions.txt
  • scripts/iwyu_filter.py
  • scripts/misra_renumber.py

📝 Walkthrough

Walkthrough

This PR introduces FreeRTOS-aware analyzer lanes to the CI infrastructure by updating container images, adding two new analysis jobs, reorganizing header includes across platform and test files to resolve compilation issues, configuring lint rules for test code and MbedTls, enhancing IWYU filtering for FreeRTOS headers, introducing a MISRA suppression renumbering tool, and providing tiered local pre-PR check documentation.

Changes

FreeRTOS analyzer lanes infrastructure

Layer / File(s) Summary
Container image SHA updates across devcontainer and CI
.devcontainer/docker-compose.yml, .github/workflows/ci.yml, ci/docker-compose.bdd.yml, docs/containers.md
cpputest, cpputest-freertos, and cpputest-freertos-cross images are pinned to new SHAs across all CI/devcontainer configuration and documentation.
New FreeRTOS analyzer jobs and summary dependency
.github/workflows/ci.yml
Two new jobs added: analyze-tidy-freertos-plustcp and analyze-iwyu-freertos-plustcp run on cpputest-freertos image with explicit clang-19 compiler for IWYU; summary job extended to await both new analyzer jobs.
Platform include reorganization and forward declarations
Platform/LwipRaw/Source/SolidSyslogLwipRawResolver.c, Platform/PlusTcp/Source/SolidSyslogPlusTcpAddress.c, Platform/PlusTcp/Source/SolidSyslogPlusTcpDatagram.c, Platform/PlusTcp/Source/SolidSyslogPlusTcpTcpStream.c
Include blocks reorganized and forward declarations for struct SolidSyslogAddress added; FreeRTOS_Sockets.h and SolidSyslogDatagram.h headers added where required; SolidSyslogStreamDefinition.h dependency removed from TcpStream.
Test file include additions and reorganization
Tests/FreeRtos/*, Tests/Lwip/*, Tests/MbedTls/*, Tests/MbedTlsIntegration/*, Tests/Support/FreeRtosFakes/Interface/*, Tests/Support/FreeRtosFakes/Source/*
Standard headers (stdint.h, stddef.h) added to test files; FreeRTOS fake headers included in test sources; unnecessary includes (cstring, semphr.h) removed; test code reformatted with consistent blank-line spacing around test declarations.
FreeRTOS fake interface and implementation headers
Tests/Support/FreeRtosFakes/Interface/FreeRTOSIPConfig.h, Tests/Support/FreeRtosFakes/Interface/FreeRtosDnsFake.h, Tests/Support/FreeRtosFakes/Interface/FreeRtosSemaphoreFake.h, Tests/Support/FreeRtosFakes/Interface/FreeRtosSocketsFake.h, Tests/Support/FreeRtosFakes/Interface/FreeRtosTaskFake.h, Tests/Support/FreeRtosFakes/Interface/portmacro.h, Tests/Support/FreeRtosFakes/Source/*
FreeRTOS.h included in fake headers; task.h and semphr.h removed from interface headers; stdint.h replaces limits.h in portmacro stub; required FreeRTOS and system headers added to fake implementations.
lwIP and MbedTls fake/support header cleanup
Tests/Support/LwipFakes/Interface/arch/cc.h, Tests/Support/MbedTlsFake.c, Tests/MbedTlsIntegration/MbedTlsTestCert.c, Tests/MbedTlsIntegration/MbedTlsTestServer.c, Tests/MbedTlsIntegration/SocketStream.c, Tests/MbedTlsIntegration/SolidSyslogMbedTlsStreamIntegrationTest.cpp
stdio/stdlib removed from lwIP arch shim; mbedtls headers (pk.h, x509_crl.h, x509_crt.h, md.h) added to support certificate generation and stream tests; sys/types.h added to integration test files; mbedtls/version.h replaces ssl.h in integration test includes.
Lint configuration for tests and MbedTls
Tests/.clang-tidy, Platform/MbedTls/.clang-tidy, Bdd/Targets/FreeRtos/Common/CmsdkUart.c, Tests/FreeRtos/CmsdkUartFake.c
Tests/.clang-tidy disables bugprone-easily-swappable-parameters in addition to readability-identifier-naming; Platform/MbedTls/.clang-tidy exempts mbedtls_ struct naming from project naming rules; NOLINTBEGIN/END directives added to UART macro definitions in production and test code with documentation comment.
Windows atomic counter loop refactoring
Platform/Windows/Source/SolidSyslogWindowsAtomicCounter.c
Moves LONG previous initialization inside do-while loop, capturing prior value directly from InterlockedCompareExchange call instead of initializing outside loop.
IWYU filter script enhancements for FreeRTOS and external paths
scripts/iwyu_filter.py
Adds FreeRTOS umbrella header filtering (FreeRTOS.h, FreeRTOS_IP.h removals) and FreeRTOSConfig/portmacro/FreeRTOS_DNS_Globals additions filtering; detects and suppresses entire IWYU blocks for third-party sources under /opt/ paths; extends docstring to document new filtering behavior.
New MISRA suppression renumbering tool and suppression updates
scripts/misra_renumber.py, misra_suppressions.txt
Introduces two-pass algorithm tool to reconcile stale MISRA suppression line numbers after IWYU-induced include changes; updates suppression entries for PlusTcp Address/Datagram and SolidSyslogFormatter.h.
Documentation updates: DEVLOG, CLAUDE, local-checks guide, and containers table
DEVLOG.md, CLAUDE.md, docs/local-checks.md, docs/containers.md
DEVLOG.md entry for S24.11 documents FreeRTOS analyzer lanes and infrastructure updates; CLAUDE.md updated to reference docs/local-checks.md; new docs/local-checks.md defines tiered pre-PR check budget (Tier A per-commit, Tier B conditional pre-push, others in CI); docs/containers.md updated with new container SHAs and IWYU version notes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • DavidCozens/solid-syslog#459: Directly implements the CI analyzer expansion for FreeRTOS/PlusTCP by adding freertos analyzer jobs, pinning freertos/cpputest image SHAs, and establishing analyze-tidy-freertos-plustcp and analyze-iwyu-freertos-plustcp lanes.

Possibly related PRs

  • DavidCozens/solid-syslog#417: Both PRs enhance MISRA-suppressions handling; this PR introduces scripts/misra_renumber.py and updates misra_suppressions.txt, while PR #417 rebuilds suppressions and renumbers deviation IDs across tiers.
  • DavidCozens/solid-syslog#261: Both PRs extend .github/workflows/ci.yml to add IWYU-based analysis jobs and update summary job dependencies.
  • DavidCozens/solid-syslog#368: Both PRs update misra_suppressions.txt line-specific entries and tooling to keep MISRA suppression line numbers aligned.

Poem

🐰 Container SHAs bump on the CI train,
FreeRTOS analyzers now can explain,
Headers reorganized, lint rules refined,
A two-pass tool leaves drift behind,
With tiered checks and docs so clear,
The build pipeline's crystal here! 📦✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/s24-11-extend-analyzer-coverage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1344 passed)
   🚦   build-freertos-host-tdd-plustcp: 100% successful (✔️ 1616 passed)
   🚦   build-linux-clang: 100% successful (✔️ 1296 passed)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1296 passed)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-linux-mbedtls: 100% successful (✔️ 7 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 46 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 90% successful (✔️ 44 passed, 🙈 5 skipped)
   🚦   bdd-freertos-qemu-plustcp: 86% successful (✔️ 42 passed, 🙈 7 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1149 passed)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1296 passed)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: 1 warning (low: 1)


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

…plustcp

Mirrors the existing analyze-tidy / analyze-iwyu lanes but runs on
cpputest-freertos so the Platform/{FreeRtos,PlusTcp,LwipRaw,MbedTls,
FatFs} trees and their Tests/* siblings enter the CMake configure.
The base lanes on cpputest silently skip those trees because
FREERTOS_KERNEL_PATH / MBEDTLS_DIR / LWIP_PATH / FATFS_PATH are not set.

The freertos iwyu lane overrides CMAKE_C_COMPILER explicitly to
clang-19 — cpputest-freertos ships the clang-19 binary but no `clang`
alternative (only cpputest-clang creates that alias). Could be cleaned
up later by adding the alternative to the cpputest gcc base.

Findings these lanes surface are addressed in subsequent commits on
this branch.
@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1344 passed)
   🚦   build-freertos-host-tdd-plustcp: 100% successful (✔️ 1616 passed)
   🚦   build-linux-clang: 100% successful (✔️ 1296 passed)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1296 passed)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-linux-mbedtls: 100% successful (✔️ 7 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 46 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 90% successful (✔️ 44 passed, 🙈 5 skipped)
   🚦   bdd-freertos-qemu-plustcp: 86% successful (✔️ 42 passed, 🙈 7 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1149 passed)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1296 passed)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: 1 warning (low: 1)


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

The new analyze-iwyu-freertos-plustcp lane compiles mbedTLS / lwIP /
FreeRTOS-Plus-TCP / FatFs INTERFACE-library TUs from /opt/* in the
cpputest-freertos image, so include-what-you-use surfaces ~500 findings
on those third-party trees. They are not actionable here — we don't own
those includes — and they drown out the ~37 in-tree files where the
report does want changes.

Extends scripts/iwyu_filter.py with an EXTERNAL_PATH_PREFIXES tuple
(currently /opt/) that drops whole file blocks before per-block
filtering. The cpputest-clang IWYU lane is unaffected: it never sees
/opt/* paths because that image doesn't carry the upstream sources.
@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1344 passed)
   🚦   build-freertos-host-tdd-plustcp: 100% successful (✔️ 1616 passed)
   🚦   build-linux-clang: 100% successful (✔️ 1296 passed)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1296 passed)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-linux-mbedtls: 100% successful (✔️ 7 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 46 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 90% successful (✔️ 44 passed, 🙈 5 skipped)
   🚦   bdd-freertos-qemu-plustcp: 86% successful (✔️ 42 passed, 🙈 7 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1149 passed)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1296 passed)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: 1 warning (low: 1)


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

Addresses the 11 findings analyze-tidy-freertos-plustcp surfaced on
Tests/FreeRtos/CmsdkUartFake.c. Two distinct rule categories, two
distinct treatments per discussion with David:

* 10 × cppcoreguidelines-macro-to-enum / modernize-macro-to-enum on the
  CMSDK UART register-offset and status-bit defines — wrapped in
  NOLINTBEGIN/END with a rationale comment. The #define form mirrors
  the ARM datasheet so a future reader can grep `DATA_OFFSET` against
  vendor docs. Kept the rule active at tier level so real test code
  that should use enums still gets caught.

* 1 × bugprone-easily-swappable-parameters on Fake_Write32 — disabled
  tier-wide in Tests/.clang-tidy. The rule fires routinely on legitimate
  patterns in test helpers (uintptr_t address + uint32_t value, pairs
  of comparison values) where the types carry semantic distinction the
  rule can't see. Real argument-order bugs in tests would be caught by
  the tests themselves.
@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1344 passed)
   🚦   build-freertos-host-tdd-plustcp: 100% successful (✔️ 1616 passed)
   🚦   build-linux-clang: 100% successful (✔️ 1296 passed)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1296 passed)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-linux-mbedtls: 100% successful (✔️ 7 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 46 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 90% successful (✔️ 44 passed, 🙈 5 skipped)
   🚦   bdd-freertos-qemu-plustcp: 86% successful (✔️ 42 passed, 🙈 7 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1149 passed)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1296 passed)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: 1 warning (low: 1)


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

Extends scripts/iwyu_filter.py with three new filter rules for FreeRTOS
ecosystem conventions that IWYU doesn't model:

* Never remove FreeRTOS.h or FreeRTOS_IP.h. Both are umbrella headers
  that set up the build environment (configMACRO_X from FreeRTOSConfig.h)
  before any sub-header is parsed. IWYU sees specific types in task.h /
  portmacro.h / FreeRTOS_DNS_Globals.h and decides the umbrella is
  redundant, but removing it breaks the upstream convention.

* Never add FreeRTOSConfig.h. Direct inclusion from Platform/FreeRtos/
  is a LayerGuard violation — the config is reached transitively via
  FreeRTOS.h. The freertos-aware analyze-iwyu lane surfaced this as the
  immediate post-apply LayerGuard failure on
  Platform/FreeRtos/Source/SolidSyslogFreeRtosSysUpTime.c.

* Never add portmacro.h or FreeRTOS_DNS_Globals.h. Both are private to
  the FreeRTOS-Plus-TCP implementation; consumers reach BaseType_t and
  freertos_addrinfo via the umbrellas.

Without these rules, iwyu-apply against the freertos image either
breaks LayerGuard (FreeRTOSConfig.h add) or produces files that fail to
parse (FreeRTOS_*.h sub-headers ahead of FreeRTOS.h). With them, the
freertos-aware analyze-iwyu lane settles cleanly.
Drives include hygiene to clean in the previously-unanalysed trees that
analyze-iwyu-freertos-plustcp now sees. Generated via the iwyu-apply
target running with the FreeRTOS-umbrella filter rules in the previous
commit, then verified via:

  cmake --preset debug -B build/iwyu-verify
  cmake --build build/iwyu-verify --target junit BddTargetTests

inside cpputest-freertos:sha-a0c1c0a. All tests pass; analyze-iwyu lane
settles cleanly.

Touches 31 files across Platform/{FreeRtos,PlusTcp,LwipRaw}/Source/,
Tests/{FreeRtos,Lwip,MbedTls,MbedTlsIntegration}/, and Tests/Support/
fakes. The dominant pattern is adding stdint / stdbool / standard-C
headers that were transitively pulled in before, plus moving
"#include "X.h"" up to the natural sort position relative to system
headers.

No source-level behaviour change: the binary set produced is bit-for-
bit identical except for line-number debug info shifts.
@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1344 passed)
   🚦   build-freertos-host-tdd-plustcp: 100% successful (✔️ 1616 passed)
   🚦   build-linux-clang: 100% successful (✔️ 1296 passed)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1296 passed)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-linux-mbedtls: 100% successful (✔️ 7 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 46 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 90% successful (✔️ 44 passed, 🙈 5 skipped)
   🚦   bdd-freertos-qemu-plustcp: 86% successful (✔️ 42 passed, 🙈 7 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1149 passed)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1296 passed)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: 1 warning (low: 1)


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

…mbers

When a refactor or IWYU pass shifts source lines, the line-anchored
entries in misra_suppressions.txt go stale and the cppcheck-misra gate
fails on findings it has always passed — just at a new line. The
clerical fix-up (re-edit the suppressions file by hand) has been a
recurring tax on pre-PR time.

scripts/misra_renumber.py automates it. Two passes:

1. Audit against unsuppressed findings (cppcheck --addon=misra without
   the suppressions list). For each (rule, file) pair where the
   suppression entries match the findings in count but not in lines,
   remap ascending-by-ascending — handles bulk refactors that touch
   many sites in one file.

2. Residual failures with suppressions in place. cppcheck dedupes per
   location, so when 11.2 and 11.3 both fire at the same line and only
   11.2 is reported, pass 1 can't see 11.3. Pass 2 runs cppcheck WITH
   the suppressions list, picks up the residual failures, and updates
   single-entry (rule, file) suppressions.

Conservative on ambiguity — bails on (rule, file) pairs whose
suppression count and finding count diverge, so a real new finding or
deleted suppression doesn't get silently mis-mapped.

This commit also applies the tool's output to misra_suppressions.txt
for the three shifts the IWYU apply in the previous commits introduced:

  misra-c2012-11.2:.../SolidSyslogPlusTcpAddress.c  :9  -> :10
  misra-c2012-11.3:.../SolidSyslogPlusTcpAddress.c  :9  -> :10
  misra-c2012-11.3:.../SolidSyslogPlusTcpDatagram.c :47 -> :49

cppcheck-misra now passes locally with the updated suppressions list.
Mirrors the suppression already in place on the host-side fake
(Tests/FreeRtos/CmsdkUartFake.c) — same NOLINTBEGIN/END bracket, same
rationale: register-offset, control-bit, and status-bit macros that
mirror the ARM CMSDK UART hardware datasheet keep their #define form so
a future reader can grep against vendor docs.

Surfaced by the new analyze-tidy-freertos-plustcp lane on the cross-
compiled BDD target build.

Audit of inline cppcheck-suppress / NOLINT comments tier-wide is
scheduled as a separate story under E10 (not S24.11).
The unconditional first iteration of the CAS loop assigns `previous`
via InterlockedCompareExchange before reading it, so the initial 0 is
never used. Moves the declaration into the loop body, which both
satisfies cppcheck's unreadVariable rule and limits the variable's
scope to where it's actually live.

Pre-existing finding sitting silently in the cppcheck-report.xml
artifact across many prior CI runs — S24.11 promoted reading the whole
cppcheck output to a habit, which surfaced it.
@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1344 passed)
   🚦   build-freertos-host-tdd-plustcp: 100% successful (✔️ 1616 passed)
   🚦   build-linux-clang: 100% successful (✔️ 1296 passed)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1296 passed)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-linux-mbedtls: 100% successful (✔️ 7 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 46 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 90% successful (✔️ 44 passed, 🙈 5 skipped)
   🚦   bdd-freertos-qemu-plustcp: 86% successful (✔️ 42 passed, 🙈 7 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1149 passed)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1296 passed)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

The SolidSyslogMbedTlsStreamConfig API takes integrator-supplied handles
of upstream Mbed TLS types — `mbedtls_ctr_drbg_context`,
`mbedtls_x509_crt`, `mbedtls_pk_context` — see project_mbedtls_di_handles.
The Interface/ header forward-declares those structs to keep public
consumers free of mbedTLS includes, which trips the project's
StructCase + StructPrefix rules (snake_case `mbedtls_*` is neither
CamelCase nor SolidSyslog-prefixed). Renaming is impossible — they're
third-party.

Adds Platform/MbedTls/.clang-tidy with a StructIgnoredRegexp override
that re-states the root whitelist plus the mbedtls_ namespace. The
config applies to both Interface/ and Source/ via clang-tidy's
walk-up-the-tree resolution. Surfaced by analyze-tidy-freertos-plustcp;
verified locally with `cmake --preset tidy && cmake --build`.

clang-tidy CheckOption values do not merge across the hierarchy
(latest-encountered wins), so the platform-level file restates the
root pattern verbatim. Re-stating beats relying on regex-OR with the
root, which would be ambiguous to read at the override site.
Codifies the agreement reached at the start of S24.11: full CI suite
takes 10-15 minutes; running every lane locally before pushing burns
human time for confidence we mostly already have from the previous
push's CI result. Split into:

- Tier A (per-commit, ~30-60 s): debug build + tests for matching preset
- Tier B (pre-push, ~3-5 min, scoped): IWYU + format reflow + misra_renumber
- CI (everything else): tidy, sanitize, coverage, Windows, BDD, integration

Tier B runs only when production source changed — tests-only, docs-only
or CMake-only diffs push immediately and let CI run. The path-gating is
the engineer's judgement; the doc spells out the rule.

The doc also captures the two non-obvious mechanics from this session:

- `analyze-iwyu-freertos-plustcp` lane needs CMAKE_C_COMPILER=clang-19
  override (the gcc base image carries clang-19 with no `clang` alias)
- IWYU output should be read whole, not head/tail — easy to miss
  findings that sit in the middle of a long report

Updates CLAUDE.md "Before raising a PR" section to point at the new doc
rather than recite the (now-stale) preset list.
@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1344 passed)
   🚦   build-freertos-host-tdd-plustcp: 100% successful (✔️ 1616 passed)
   🚦   build-linux-clang: 100% successful (✔️ 1296 passed)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1296 passed)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-linux-mbedtls: 100% successful (✔️ 7 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 46 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 90% successful (✔️ 44 passed, 🙈 5 skipped)
   🚦   bdd-freertos-qemu-plustcp: 86% successful (✔️ 42 passed, 🙈 7 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1149 passed)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1296 passed)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1344 passed)
   🚦   build-freertos-host-tdd-plustcp: 100% successful (✔️ 1616 passed)
   🚦   build-linux-clang: 100% successful (✔️ 1296 passed)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1296 passed)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-linux-mbedtls: 100% successful (✔️ 7 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 46 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 90% successful (✔️ 44 passed, 🙈 5 skipped)
   🚦   bdd-freertos-qemu-plustcp: 86% successful (✔️ 42 passed, 🙈 7 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1149 passed)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1296 passed)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1344 passed)
   🚦   build-freertos-host-tdd-plustcp: 100% successful (✔️ 1616 passed)
   🚦   build-linux-clang: 100% successful (✔️ 1296 passed)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1296 passed)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-linux-mbedtls: 100% successful (✔️ 7 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 46 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 90% successful (✔️ 44 passed, 🙈 5 skipped)
   🚦   bdd-freertos-qemu-plustcp: 86% successful (✔️ 42 passed, 🙈 7 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1149 passed)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1296 passed)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@DavidCozens DavidCozens marked this pull request as ready for review May 26, 2026 19:22
@DavidCozens DavidCozens merged commit dfb3cb2 into main May 26, 2026
22 of 23 checks passed
@DavidCozens DavidCozens deleted the ci/s24-11-extend-analyzer-coverage branch May 26, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

S24.11: Extend tidy / cppcheck / IWYU CI to cover platform + BDD code

1 participant