Repository navigation
v0.6.0
False-Positive Fixes Across the Core Rules
This release clears the false-positive families that forced ziglint-ignore
comments across real codebases. Five rule families were misfiring on
idiomatic Zig; each fix was driven by a live corpus of ignores and is
covered by regression tests.
Highlights
- Z028:
const log = @import("log.zig").scoped(.mod);— chained calls on
imports are allowed when the result lands in a top-level const. The
std.log.scopedidiom with a project-local module no longer flags. - Z015: composed error sets (
pub const E = A || B || error{...}) are
recognized as public type declarations. Every pub function returning one
was previously flagged as exposing a private error set. - Z006: type aliases built with any type-returning builtin —
@Vector,
@Frame,@Struct,@Fn,@This,@TypeOf— are recognized by a single
shared list.const Chunk = @Vector(N, u8)no longer flags as a camelCase
variable. - Z012: the private-type check now searches every enclosing container
(methods ofConnection.Ioreferencing types pub inConnection), exempts
container-self references (fn bar(self: *Foo)) andSelf = @This()
aliases, and understandsunion(enum)containers. - Z012 (new coverage): pointer, slice, and array signatures are now
traversed, sopub fn take(h: *Hidden)— previously invisible — is
checked like any other exposure. - Z006/Z012 (semantic mode): with the module graph, camelCase
type-functions (std.log-parityscoped/withContext) resolve through the
TypeResolver instead of name-shape heuristics. Two resolver bugs fixed on
the way:@import("x.zig")was typed with the importing module's path,
and module-root functions were unsearchable. - Z023 (semantics change): the rule now orders structural parameters
only —comptime T: type, then comptime values, thenAllocator, then
Io. Runtime value parameters are position-free, so writer-first APIs
(std.fmt.format(writer, comptime fmt, args)) and ctx-then-callback
registrations no longer flag. - Crash fix: container member lookups returned a dangling slice into a
dead stack frame; only some stack layouts (CI) read garbage and crashed.
Callers now own the buffer. - Z026 docs: the preferred fix for best-effort stdio catches is now
documented — astd.debug.print-style void wrapper that swallows the
error once, so call sites never need a catch.
Breaking Changes
None in the library API. Diagnostic output changes in both directions:
Z023 is relaxed (fewer diagnostics), and Z012 pointer traversal means
genuine exposures through *T, []T, and [N]T now newly flag.
Installation
mise use github:rockorager/ziglint