Skip to content

DonIsaac/zlint

Repository files navigation

ZLint

codecov CI

An opinionated linter for the Zig programming language.

Warning

This project is still very much under construction.

Features

  • ZLint has its own semantic analyzer, heavily inspired by the Oxc project, that is completely separate from the Zig compiler. This means that ZLint still checks and understands code that may otherwise be ignored by Zig due to dead code elimination.
  • Pretty, detailed, and easy-to-understand error messages. image

Installation

Pre-built binaries are available for each release. The latest release can be found here. Note that pre-built windows binaries are not yet available.

Building from Source

Clone this repo and compile the project with Zig.

zig build --release=safe

Lint Rules

All lints and what they do can be found here.

Configuration

Create a zlint.json file in the same directory as build.zig. This disables all default rules, only enabling the ones you choose.

{
  "rules": {
    "no-undefined": "error",
    "homeless-try": "warn"
  }
}

Contributing

If you have any rule ideas, please add them to the rule ideas board.

Interested in contributing code? Check out the contributing guide.