Skip to content

v0.10.0

Latest

Choose a tag to compare

@github-actions github-actions released this 17 Sep 02:38
· 23 commits to main since this release
v0.10.0
3ef67af

v0.10.0 is here! It includes some very breaking changes.

Read the v0.10.0 blogpost for a detailed description of this version's features

Breaking Changes

zlint.json no longer defaults to every rule being off

This is the big one. Previously, the mere presence of a zlint.json turned all
rules off, and you had to opt back in to each one individually:

{
  "rules": {} // before v0.10.0: nothing runs at all
}

Now rules run at their default severities, and zlint.json will override/adjust them.

{
  "rules": {
    // everything else has default behavior.
    "unsafe-undefined": "error",
    "homeless-try": "warn",
    "unused-decls": "off"
  }
}

What to do: if your config was an explicit allowlist, you'll now get diagnostics from rules you never enabled. Set the ones you don't want to "off". Run zlint once after upgrading and see what shows up - it's usually a short list.

ignore patterns are globs now

ignore used to match with "starts with" semantics. It now takes real glob patterns, which means a bare folder name matches the folder and not everything inside it:

{
  "ignore": [
    // before
    "src/codegen",
    // after
    "src/codegen/**",
  ],
}

Add /** to your existing entries and you're done. In exchange you get patterns
that were previously impossible:

{
  "ignore": ["src/codegen/**", "src/**/*_test.zig", "**/*.gen.zig"]
}

Other Changes

  • Custom userland rules and build.zig integration. This one is really cool (seriously, read the blogpost)
  • zlint upgrade will update zlint in-place
  • Control Flow Analysis support, with cfg-enabled rules coming soon
  • lots of bugfixes

What's Changed

  • fix(unused-decls): keep doc comments attached when autofixing by @DonIsaac in #404
  • chore: change static library artifact name to zlint-lib by @vleema in #405
  • fix(tests): Make sure CLI tests get run by @DonIsaac in #403
  • refactor(sema): use .root and .empty conventions by @DonIsaac in #409
  • feat: Add build.zig util (start of path for source based distribution with comptime rule config) by @MichaelBelousov in #410
  • fix(sema): preserve while body scope flags by @incidere in #413
  • perf(parse): dont tokenize twice by @DonIsaac in #408
  • Custom rules as build option by @MichaelBelousov in #411
  • feat(cli): add zlint self-update command by @DonIsaac in #414
  • fix(homeless-try): resolve named error union return type aliases by @DonIsaac in #415
  • feat(fmt): ASCII formatting by @DonIsaac in #418
  • fix(linter/duplicate-cast): Improve AST structural comparison coverage by @DonIsaac in #419
  • feat(sema): Control Flow Analysis by @DonIsaac in #412
  • fix(reporter): render multiline spans with left-hand arrows by @DonIsaac in #420
  • fix(reporter): use monotonic loading when updating statistics by @DonIsaac in #423
  • feat(cli): add --config <path> option by @DonIsaac in #424
  • feat(linter): Perform control flow analysis when rules need it by @DonIsaac in #425
  • test(cli): test lint command inclusion/exclusion behavior by @DonIsaac in #426
  • feat(config)!: ignore supports glob patterns by @DonIsaac in #357
  • feat(glob): GlobSet supports pattern negation by @DonIsaac in #380
  • refactor: simplify config reading and resolution by @DonIsaac in #428
  • fix(cli)!: treat named arguments as file/folder paths by @DonIsaac in #429
  • up(lint)!: zlint.json does not default to empty rule set by @DonIsaac in #430
  • chore: replace prettier with oxfmt by @DonIsaac in #431
  • chore: v0.10.0 by @DonIsaac in #432

New Contributors

Full Changelog: v0.9.1...v0.10.0