NI

nimpretty & nimcheck

Formatting with nimpretty and static checking with nim check for idiomatic Nim code

Details

Language / Topic
nimNim
Category
Linter / Formatter

Rules

balanced
- Run `nimpretty --indent:2 src/mymodule.nim` to format source files — use `--check` flag in CI to fail on unformatted files without modifying them.
- Run `nim check src/mymodule.nim` to type-check modules without compiling to binaries — integrate this into CI before running tests.
- Enable `{.warning[UnusedImport]: on.}` and `{.warning[XDeclaredButNotUsed]: on.}` pragmas to surface dead code warnings during compilation.
- Compile with `--styleCheck:usages` to enforce consistent identifier casing across the codebase and catch style violations at compile time.