1/nektro/ziglint v0.18

A linting suite for Zig


ziglint

loc license

A linting suite for Zig.

Usage

$ ./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.

Installation

This requires having Zig and Zigmod installed.

  • https://ziglang.org/download/
  • https://github.com/nektro/zigmod/releases
$ zigmod aq install 1/nektro/ziglint

Built With

Available Rules

  • dupe_import: warn against duplicate @import calls with the same value
  • todo: list all // TODO comments
  • file_as_struct: checks for file name capitalization in the presence of top level fields
  • unused_decl: checks for unused container level const/vars

Want to propose more? Open an issue here on Github.

Using in Github Actions

jobs:
  lint:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Setup Zig
        uses: goto-bus-stop/setup-zig@v1
        with:
          version: "0.10.0"

      - uses: nektro/actions-setup-zigmod@v1
      - run: zigmod aq install 1/nektro/ziglint
      - run: ~/.zigmod/bin/ziglint -skip todo

License

MIT

Package Contents

  • .gitattributes
  • zigmod.lock
  • LICENSE
  • .github/workflows/zig.yml
  • .github/issue_template/fakse_negative.yml
  • .github/issue_template/new_rule.yml
  • .github/issue_template/false_positive.yml
  • build.zig
  • src/main.zig
  • src/tools/todo.zig
  • src/tools/file_as_struct.zig
  • src/tools/unused_decl.zig
  • src/tools/dupe_import.zig
  • README.md
  • zig.mod
  • bad/todo.zig
  • bad/file_as_struct.zig
  • bad/unused_decl.zig
  • bad/dupe_import.zig
  • .gitignore

Root Dependencies

  • git https://github.com/nektro/zig-range
  • git https://github.com/nektro/zig-flag

History

Published On Tree @ Commit Size
v0.18 Wed, 16 Nov 2022 16:52:56 UTC Tree 40.579 KB
v0.17 Wed, 28 Sep 2022 22:40:46 UTC Tree 34.286 KB
v0.16 Wed, 14 Sep 2022 20:02:46 UTC Tree 34.311 KB
v0.15 Fri, 19 Aug 2022 22:56:29 UTC Tree 34.323 KB
v0.14 Mon, 01 Aug 2022 07:06:54 UTC Tree 34.316 KB
v0.13 Mon, 18 Apr 2022 00:47:26 UTC Tree 34.176 KB
v0.12 Mon, 07 Mar 2022 01:38:41 UTC Tree 34.156 KB
v0.11 Sun, 09 Jan 2022 12:02:59 UTC Tree 34.177 KB
v0.10 Sat, 08 Jan 2022 11:33:59 UTC Tree 12.543 KB
v0.9 Sat, 08 Jan 2022 01:58:04 UTC Tree 11.551 KB
v0.8 Sat, 08 Jan 2022 01:06:42 UTC Tree 10.212 KB
v0.7 Fri, 07 Jan 2022 00:10:01 UTC Tree 9.513 KB
v0.6 Thu, 06 Jan 2022 12:33:00 UTC Tree 7.732 KB
v0.5 Thu, 06 Jan 2022 02:45:17 UTC Tree 7.659 KB
v0.4 Sat, 28 Aug 2021 02:35:38 UTC Tree 7.659 KB
v0.3 Sat, 28 Aug 2021 02:32:46 UTC Tree 7.659 KB
v0.2 Fri, 27 Aug 2021 05:42:49 UTC Tree 6.488 KB
v0.1 Mon, 23 Aug 2021 02:27:55 UTC Tree 6.486 KB