Skip to content

Latest commit

 

History

History
51 lines (32 loc) · 1.65 KB

README.rst

File metadata and controls

51 lines (32 loc) · 1.65 KB

Lint

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 some built-in checks and an accompanying GitHub action to make it easy to enable linting in your CI process.

Quickstart

  1. Install lint with nimble:
$ nimble install lint
  1. 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.

  1. 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.

License

Licensed under either of:

at your option.