align: sync fork with upstream rockorager Zig 0.16 migration#2
Conversation
Switch runtime and build integration to explicit std.Io and std.process.Init APIs required by Zig 0.16.\n\nReplace removed @Type-based rule config reification with @struct, migrate filesystem and process helpers across config/module/doc-test codepaths, and update test fixtures to the new tmp-dir IO signatures while preserving existing lint behavior. Amp-Thread-ID: https://ampcode.com/threads/T-019d964a-6031-744f-9b3e-6cf585c43982 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d964a-6031-744f-9b3e-6cf585c43982 Co-authored-by: Amp <amp@ampcode.com>
EugOT/ziglint had diverged: 5 commits behind upstream and carrying a parallel 0.16 migration (#1) whose build.zig.zon still declared minimum_zig_version "0.15.2". This merges upstream/main to adopt the canonical maintainer migration while preserving EugOT's value-adds. Adopted from upstream (non-conflicting, merged cleanly): - build.zig.zon minimum_zig_version 0.15.2 -> 0.16.0 (fixes the stale pin) - .github/workflows ci.yml + release.yml -> Zig 0.16.0 - flake.nix -> zig_0_16 Kept from EugOT on the 8 convergent-migration source conflicts (both sides migrated the same files to 0.16; EugOT's is equivalent AND carries unique value): - ModuleGraph.zig sentinel-correct realPathFileAlloc ([:0]const u8 + errdefer) that fixes the "Allocation size N+1 vs free size N" DebugAllocator panic — upstream still uses the un-sentineled form. - build.zig lint_smoke self-lint gate (runs ziglint on its own source, expectExitCode(1) until residual style findings are cleared) + lint alias. - the .agents/.claude/AGENTS.md agentic-QC overlay. VALIDATION: mise x zig@0.16.0 -- zig build test --summary all -> 7/7 steps succeeded, 274/274 tests passed. The lint_smoke gate runs and reports residual findings (deprecated indexOf->find, Z023 param order) as expected via expectExitCode(1); the build still succeeds.
|
Warning Review limit reached
More reviews will be available in 3 hours, 39 minutes, and 53 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Synchronizes this fork with upstream’s Zig 0.16 migration by updating the declared minimum Zig version and aligning CI/release/dev-shell tooling to Zig 0.16.0.
Changes:
- Bump
build.zig.zonminimum_zig_versionto0.16.0. - Update GitHub Actions CI and release workflows to install Zig
0.16.0. - Update Nix flake devShell to use
zig_0_16/zls_0_16and refresh the flake lock inputs.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| flake.nix | Dev shell now targets Zig/ZLS 0.16. |
| flake.lock | Updates pinned Nix inputs to match the flake changes. |
| build.zig.zon | Raises the minimum Zig version to 0.16.0. |
| .github/workflows/release.yml | Releases build with Zig 0.16.0. |
| .github/workflows/ci.yml | CI builds/tests with Zig 0.16.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Review Roast 🔥Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything. The checkout version mismatch from the previous review has been fixed - both CI and release workflows now wear matching Like a well-oiled assembly line — version numbers are aligned, dependencies are updated, and the only thing missing is the celebratory commit message that says "finally, no more chaos." 📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are. Files Reviewed (5 files)
Reviewed by laguna-m.1-20260312:free · 397,069 tokens |
…rrors (#7) WHY: A full multi-agent adversarial audit of the fork delta vs upstream (bfcb30d..b212557, 24 raw findings → 3 confirmed after verification) surfaced three real, verified defects present at HEAD: 1. Z029 (redundant @as in struct init) only compared bare-identifier field types, so `@as(*u32, ...)`, `@as(?T, ...)`, `@as([N]T, ...)` and `@as(a.b.C, ...)` on struct fields were silently skipped — genuine linter false negatives (the tool's core job). 2. lintDirectory's `walker.next(io) catch null` ended traversal silently on a permission error / symlink loop, leaving the rest of the tree un-linted with no diagnostic. 3. main's `FileConfig.load(...) catch .{}` swallowed config-discovery errors (e.g. an allocation failure joining the search path) without logging. All three are pre-existing upstream but ship in the fork; this cycle's scope was the whole fork-vs-upstream delta. WHAT: - Linter.zig: findContainerFieldTypeInTree now returns the field type's raw source (Ast.getNodeSource) instead of only `.identifier`. Added getAsTypeText (source of an `@as` cast's type node) and typeTextEql (whitespace-insensitive compare). checkRedundantAsInStructInit compares source text, so all composite field types are handled. getAsTypeName is retained (still used by call-arg / array / return / value paths). - main.zig: directory-walk errors now print a warning before stopping; config load logs the error before falling back to defaults. Both Z026-clean. - Added 4 Z029 regression tests (pointer/optional/array detection + a different-pointer-type negative case). IMPACT: src/Linter.zig, src/main.zig. No behavior change for the previously handled identifier case; new detections are strict (whitespace-normalized exact type-text match, so different types still don't trigger). Linter now catches a class of redundant casts it previously missed and no longer fails silently on unreadable directories/config. VALIDATION: TDD — the 3 composite-type tests failed (expected 1, found 0) before the fix and pass after. `zig build test --summary all` => 7/7 steps, 281/281 tests pass, zig fmt clean, self-lint (run exe ziglint) clean. The self-lint gate also caught an empty `catch {}` in the first draft of fix #2 (Z026), which was corrected to `try`.
Why
EugOT/ziglint had diverged from upstream rockorager/ziglint: 5 commits behind, with a parallel 0.16 migration (#1) whose
build.zig.zonstill declaredminimum_zig_version = "0.15.2". This fork-sync adopts upstream's canonical maintainer migration while preserving EugOT's value-adds, aligning the Zig-code QC.Adopted from upstream (merged cleanly, non-conflicting)
build.zig.zonminimum_zig_version0.15.2 → 0.16.0 (fixes the stale pin).github/workflows/ci.yml+release.yml→ Zig 0.16.0flake.nix→zig_0_16Kept from EugOT on the 8 convergent-migration source conflicts
Both sides migrated the same files to 0.16; EugOT's is equivalent and carries unique value:
ModuleGraph.zigsentinel-correctrealPathFileAlloc([:0]const u8+errdefer) — fixes the "Allocation size N+1 vs free size N" DebugAllocator panic that upstream's un-sentineled form still has.build.ziglint_smokeself-lint gate (runs ziglint on its own source;expectExitCode(1)until residual style findings are cleared) +lintalias..agents/.claude/AGENTS.mdagentic-QC overlay.Validation
mise x zig@0.16.0 -- zig build test --summary all→ 7/7 steps succeeded, 274/274 tests passed. Thelint_smokegate runs and reports residual findings (deprecatedindexOf→find, Z023 param order) as expected viaexpectExitCode(1); the build still succeeds.Follow-up (non-blocking)
The residual
indexOf→find/Z023param-order findings the self-lint surfaces are a small cleanup that would let the gate move toexpectExitCode(0).