Lint is a toolkit to write and run linting checks on Nim projects.
Thanks to its modular architecture, Lint allows you to BYOL—bring your own linter: - you can write a standalone Nim module with your linting checks and ship it as part of your project - or you can publish it as a Nimble package so that anyone could use in in their projects
Lint ships with an accompanying GitHub action to make it easy to enable linting in your CI process.
- Install lint with nimble:
$ nimble install lint
- Write a linter config (see an example in tests/linter.nim.
Note
Lint config is a compiled Nim file. This is a bit unorthodox as you usually see configs written in YAML, TOML, or JSON. However, using Nim for configuration allows Lint to employ user-provided linters: the compiled binary has all your checks baked in.
Also, because it's regular Nim, you never get an incorrect config due to a typo and you can enjoy autocompletions while you edit it.
- Compile and run your linter:
$ nim c -d:release linter.nim $ ./linter # lint entire project $ ./linter myfile.nim # or a single file $ ./linter dir # or a directory $ ./linter dir/s*.nim # or a glob pattern
Full docs are at iftech.github.io/nim-lint.
Licensed under either of:
- Apache License 2.0 LICENSE-APACHEv2
- MIT license LICENSE-MIT
at your option.