A linting suite for Zig.
$ ./ziglint
This will search the current directory for .zig
files and lint them against the various tests in the suite. See the bad/ folder for examples of the caught lints.
This requires having Zig and Zigmod installed.
- https://ziglang.org/download/
- https://github.com/nektro/zigmod/releases
$ zigmod aq install 1/nektro/ziglint
dupe_import
: warn against duplicate@import
calls with the same valuetodo
: list all// TODO
commentsfile_as_struct
: checks for file name capitalization in the presence of top level fieldsunused_decl
: checks for unused container levelconst
/var
s
Want to propose more? Open an issue here on Github.
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v1
with:
version: "0.11.0"
- uses: nektro/actions-setup-zigmod@v1
- run: zigmod aq install 1/nektro/ziglint
- run: ~/.zigmod/bin/ziglint -skip todo
MIT