Skip to content

style: make zig fmt --check pass and enforce it in CI - #121

Merged
ata-sesli merged 2 commits into
mainfrom
style/zig-fmt
Nov 3, 2026
Merged

ata-sesli merged 2 commits into
mainfrom
style/zig-fmt

Conversation

@ata-sesli

Copy link
Copy Markdown
Member

Summary

zig fmt --check build.zig src now passes on every tracked Zig file, and CI runs it so it stays that way.

Problem

src/simhash/minhash.zig was not formatted the way zig fmt 0.17 lays it out. #119 fixed the only other offender, src/watcher/watcher.zig. Nothing in CI ran zig fmt, so this kind of drift could reach main unnoticed.

Changes

  • style(simhash): satisfy zig fmt. Realigns the three string-list literals in normaliseNodeType. Whitespace only.
  • ci: check Zig formatting. Adds a zig fmt --check build.zig src step to the sdk job in ci.yml. That job already installs Zig 0.17.0 through setup-zova, so the step needs no new action and no extra setup.

Verification

  • zig fmt --check build.zig src (Zig 0.17.0) passes locally. It covers all 14 tracked .zig / .zon files.
  • zig ast-check src/simhash/minhash.zig passes. The diff is whitespace only, so I did not rerun the test suite.
  • tests/test_github_workflows.sh, tests/test_zova_build_workflow.sh and git diff --check pass.
  • The new CI step itself runs for the first time on this PR.

Realign the node-type name lists in normaliseNodeType the way zig fmt
0.17 lays them out. Whitespace only; this was the last tracked Zig file
that failed zig fmt --check.

Signed-off-by: ata-sesli <atasesli@protonmail.com>
Run zig fmt --check on build.zig and src/ in the sdk job, which already
installs Zig 0.17.0 through setup-zova, so an unformatted Zig file fails
CI instead of reaching main.

Signed-off-by: ata-sesli <atasesli@protonmail.com>
@ata-sesli ata-sesli added this to the v2.0.1 milestone Nov 3, 2026
@ata-sesli
ata-sesli merged commit 31ef061 into main Nov 3, 2026
5 checks passed
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