ziglint
ziglint copied to clipboard
A linting suite for Zig
if `errdefer` is in a block and then followed by not statements that use try or catch, the errdefer is unreachable and should be warned against
```zig if (foo) { defer bar(); } ``` `bar` is defer'd in a block where it's the only statement. this is a no-op. additionally consider warning that if in an...
inspired by https://eslint.org/docs/latest/rules/no-useless-assignment
its not something that should never be used, but using a discrete enum almost always makes code more readable and produces better error messages. `FieldEnum` and `DeclEnum` from `std.meta` go...
less error prone rationale: https://github.com/ziglang/zig/issues/19480
```zig var i: usize = 0; while (i < 8) : (i += 1) { ... } ``` to ```zig for (0..8) |i| { ... } ```
First of all, nice tool! I've integrated this tool to Emacs with `flycheck` and `flymake`. - https://github.com/flycheck/flycheck-ziglint - https://github.com/flymake/flymake-ziglint I wonder can we pass filename to ziglint? For example: ```...
```zig test { const E = enum { a, b, c }; const a = E.a; switch (a) { .a => {}, else => {}, .c => {}, } }...
👋 looks like a fun project, any thoughts of tagging a release? Thanks!