Skip to content

chore(format): fail make format on clang-format version mismatch - #105

Open
AlexKlimaj wants to merge 1 commit into
ark-releasefrom
chore/clang-format-pin-check
Open

chore(format): fail make format on clang-format version mismatch#105
AlexKlimaj wants to merge 1 commit into
ark-releasefrom
chore/clang-format-pin-check

Conversation

@AlexKlimaj

Copy link
Copy Markdown
Member

Why

.github/workflows/static-analysis.yml installs clang-format==22.1.5, but scripts/format.sh only required some clang-format on PATH. AGENTS.md tells every contributor (and agent) to run make format before committing, so a machine with a different version produced whitespace-only MCU diffs that CI check_format then rejected (seen as a commit/revert pair on the nFAULT stack).

What

  • Pin 22.1.5 in format.sh and fail if the local binary does not match.
  • Point the install error at pip install --user 'clang-format==22.1.5' (drop the distro-package suggestion; that is how the mismatch happens).
  • Escape hatch: CLANG_FORMAT_SKIP_VERSION=1 (not for PRs).

No C sources are rewritten.

CI pins clang-format==22.1.5 in static-analysis.yml. format.sh only
printed whatever was on PATH, so a local make format with another
version produced whitespace commits that check_format then rejected.
Require the pinned version (override: CLANG_FORMAT_SKIP_VERSION=1).
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.

1 participant