ziglint Changelog View on GitHub

Changelog

0.9.0 - 2026-11-24

Any rule's note, in the terminal

ziglint --explain Z024 prints what a rule does, what it saw, and how to fix it, without leaving the terminal. ziglint --list-rules prints the index, so a code in a finding is one command away from its note.

Added

Changed

0.8.3 - 2026-11-13

Z011 Finds Deprecations Behind orelse and Binary Operators

0.8.2 taught Z011 to resolve a method receiver that is a function parameter, which is what b.lazyDependency(...) in a build.zig needs. It did not cover the shape those calls usually take:

const testingx_dep = b.lazyDependency("testingx", .{ .target = target }) orelse
    return;

The receiver resolved to nothing, so the call went unreported.

Fixes

Verification

0.8.2 - 2026-11-13

Z012 Sees Through Aliases, Z011 Finds Build-File Deprecations

This release fixes a class of Z012 false positives on type aliases, the false negatives that hid behind them on qualified paths, and the Z011 gap that kept b.lazyDependency(...) in a build.zig from being reported.

Fixes

Verification

One diagnostic per report site is now enforced, and the Z012 and Z011 changes were diffed against the whole Zig 0.16 tree before release: 17 new reports, all confirmed as genuine findings, and 2 Z012 false positives removed. No other rule's output changed.

0.8.1 - 2026-11-07

Fixes a Crash Resolving Methods on Nested Stdlib Types

ziglint 0.8.0 could segfault, or report the wrong thing, on a call to a method of a stdlib type that is declared inside a module std.zig imports, such as std.zig.Color.settingFromEnvironment(...) or std.zig.EnvVar.ZIG_LOCAL_CACHE_DIR.get(...). Whether it crashed depended on memory layout, so the same tree could pass on one run and crash on the next, and passing --zig-lib-path only moved the crash around.

Fixes

0.8.0 - 2026-10-30

What's New

Z035: Use an alias instead of the qualified path

When a file declares a top-level alias such as const testing = std.testing;, Z035 reports calls that spell the qualified path instead:

Z035: test.zig:9: use alias 'testing' instead of 'std.testing'

The declaration itself is never reported. This catches the file where one test uses testing.expect(...) and a newly added test uses std.testing.expect(...). Aliases of namespaces, types, functions, and values are matched by path. Nested aliases report the longest match once.

A use is skipped when it is an argument to a call, or an operand of == or !=, that also names the alias elsewhere in the expression. This keeps tests such as expectEqual(alias, path) from receiving a suggestion that would make the comparison vacuous.

Known limitations: only top-level aliases initialized directly from a path are tracked, and path text is compared without resolving shadowed names.

Z035 is enabled by default. Running it over the Zig standard library produces 1,630 findings; running over the baskingspot repositories produced 124 findings in 34 files.

0.7.1 - 2026-10-25

Fixes Z011 Coverage in Type Positions and Stdlib Aliases

Z011 reported deprecated calls reached by the recursive AST walk, but that walk stops at function signatures, container fields, and type wrappers. A std.meta.Int() call in a return type or struct field passed without a warning, while the same call in a function body was reported.

Fixes

The wider sweep found 21 calls to the deprecated std.mem.indexOf, indexOfScalar, and indexOfPos aliases in ziglint itself, hidden under orelse and or expressions. They now use find, findScalar, and findPos.

0.7.0 - 2026-10-20

New Rule and a Z011 Detection Fix

This release adds Z034 and fixes Z011 so that deprecations on whole stdlib modules are detected, not just deprecations on the called declaration.

What's New

Z034: Use writeAll for literal prints on Io.Writer

writer.print("literal", .{}) performs no formatting. With an empty args tuple, print walks the literal and calls writeAll on it anyway. The empty tuple exists only because print requires it, and the call reads as if interpolation was intended. Z034 recommends writeAll instead.

The receiver must resolve to std.Io.Writer. Unresolved receivers are skipped because std.debug.print and std.json.Stringify.print have the same call shape but no writeAll alternative. Function parameters, explicitly typed locals, top-level declarations, and fields of same-file types are checked. Alias chains such as const Io = std.Io; and const Writer = std.Io.Writer; resolve.

Fixes

Z011: Detect deprecated stdlib modules

A module deprecation is documented on the module declaration, not on each function it contains. std.fs.path is deprecated in Zig 0.16, but its functions are not, so std.fs.path.basename(path) passed without a warning. Z011 now walks up the receiver's module chain and reports the deprecated namespace:

Z011: main.zig:3: 'std.fs.path' is deprecated: Deprecated, use `std.Io.Dir.path`.

The marker parser also accepts the Deprecated, use ... comma form used by 128 doc comments in the Zig 0.16 standard library. Previously only Deprecated:, Deprecated;, and Deprecated in favor of were recognized.

ziglint's own std.fs.path calls moved to std.Io.Dir.path.

0.6.2 - 2026-10-13

Fixes Z006 False Positives on 0.16 Type-Constructor Builtins

Z006 flagged every PascalCase alias built with a 0.16 type-constructor builtin (@Int, @Pointer, @Struct, @Enum, @Union, @Tuple, @Fn, @FieldType, @EnumLiteral). The builtin recognition list predated 0.16: @Type was removed and replaced by these fine-grained constructors, and the list was never updated for its replacements. Against the 0.16 standard library, this release removes 24 Z006 false positives (5970 → 5946 reports) and adds none.

Fixes

0.6.1 - 2026-10-07

Fixes a 0.6.0 Regression: Member-of-Module Type Aliases Read as Private

0.6.0's resolver work introduced two stacked bugs that made Z012 flag every const X = @import("...").X; file-local alias to a type that is pub at its definition — up to 115 false positives in a single project migration. Both are fixed and covered by regression tests.

Fixes

0.6.0 - 2026-10-07

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

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.

0.5.3 - 2026-07-20

Safer, More Accurate Lint Fixes

This release focuses on making ziglint diagnostics safe to follow. Suggested changes now better preserve Zig semantics, avoid false positives, and provide enough context to produce compiling fixes.

Highlights

Additional corrections clarify deprecation markers, private error-set API impact, accepted @This() aliases, and Z024's byte-based line-length limit.

Test Coverage

Documentation examples can now include compiler probes. Important suggested rewrites are checked with zig test as well as ziglint, including the nullable error-union coercion that motivated the Z017 change.

0.5.2 - 2026-02-08

Performance Improvements

Module graph construction is now 3000x faster! 🚀

Dramatically improved module graph build performance through two key optimizations:

Before: ~1850ms to analyze build.zig (loading 308 modules from std with ZIR) After: ~0.6ms to analyze build.zig (loading 2 modules without ZIR)

What changed:

  1. Disabled ZIR generation - ZIR was added proactively in v0.4.0 for future control flow analysis (issue #18), but no rules currently use it. Generating ZIR took 10-50ms per module.

  2. Skip recursing into std library - When linting user code like build.zig, we don't need to parse all 300+ modules from the standard library. Now we only load the root std.zig file.

Impact on real-world usage:

# Linting a single file that imports std
Before: ~2 seconds
After:  ~0.4 seconds (5x faster)

# Linting entire src/ directory
Before: Previously slow on large projects
After:  Dramatically faster startup and analysis

These optimizations can be easily reverted if control flow analysis is implemented in the future (see well-documented code comments in src/ModuleGraph.zig).

Technical Details

0.5.1 - 2026-02-08

Bug Fixes

Z011: Fixed deprecation detection in nested contexts

Previously, ziglint failed to detect deprecated function calls inside try expressions, catch blocks, and other nested AST contexts. This was due to incomplete AST traversal in the linter.

Fixed detection for:

Technical details:

Example - now detects:

pub fn main() !void {
    // Previously missed, now detected:
    _ = try std.meta.intToEnum(MyEnum, 1);
}

Code Quality

Improvements

Known Limitations

Detection still requires improvement for:

0.5.0 - 2026-02-01

What's New

Three new naming convention rules based on the official Zig Style Guide:

Configuration

Z033 is disabled by default as it can be controversial. Enable it in .ziglint.zon:

.{
    .rules = .{
        .Z033 = .{ .enabled = true },
    },
}

0.4.1 - 2026-01-31

What's New

Bug Fixes

0.4.0 - 2026-01-31

What's New

New Rules

Bug Fixes

0.3.0 - 2026-01-30

What's New

New Lint Rules

Improvements

Documentation

Build

0.2.2 - 2026-01-25

What's New

0.2.1 - 2026-01-24

What's New

0.2.0 - 2026-01-24

What's New

New Rules

Improvements

Removed Rules

0.1.0 - 2026-01-22

What's New