Skip to content

v0.8.3

Choose a tag to compare

@github-actions github-actions released this 14 Nov 04:38
· 10 commits to main since this release
v0.8.3
00414a5

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

  • Parent map (missing edges): the map that connects a node to its parent
    covered only a subset of node tags. orelse and every binary operator were
    missing, so a walk from a use site to its enclosing function stopped at
    them. The map now covers orelse, the arithmetic, bitwise, boolean, and
    shift operators, array access and concatenation, slice expressions, and
    error unions. A call in any of those positions can reach its enclosing
    function again.

    Rules that visit a node to check it now also reach expressions in those
    positions. Against the Zig 0.16 tree this surfaces 27 findings that were
    invisible before (Z004, Z010, Z016, Z017, Z020, Z029) and corrects the type
    name in 3 Z020 messages. Every one was checked: they are calls and
    assertions written inside orelse blocks and binary expressions, not
    false positives.

Verification

  • b.lazyDependency(...) orelse return is reported; a plain
    const x = b.lazyDependency(...) was already reported in 0.8.2.
  • New tests cover a deprecated method behind orelse and behind a boolean
    operator; both fail without the parent-map fix.
  • Whole-tree diff against 0.8.2: +27 diagnostics, all confirmed above,
    and no rule's output disappears.

Installation

mise use github:rockorager/ziglint@v0.8.3