2021-10-02 08:22:22 +03:00
|
|
|
## statix
|
2021-09-11 18:48:09 +03:00
|
|
|
|
2021-10-02 08:22:22 +03:00
|
|
|
`statix` intends to be a static analysis tool for the
|
2021-09-11 18:48:09 +03:00
|
|
|
Nix programming language.
|
|
|
|
|
2021-10-02 08:22:22 +03:00
|
|
|
For the time-being, `statix` works only with ASTs
|
2021-09-11 18:48:09 +03:00
|
|
|
produced by the `rnix-parser` crate and does not evaluate
|
2021-10-02 08:22:22 +03:00
|
|
|
any nix code (imports, attr sets etc.).
|
2021-09-11 18:48:09 +03:00
|
|
|
|
|
|
|
## Architecture
|
|
|
|
|
2021-10-02 08:22:22 +03:00
|
|
|
`statix` has the following components:
|
2021-09-11 18:48:09 +03:00
|
|
|
|
|
|
|
- `bin`: the CLI/entrypoint
|
|
|
|
- `lib`: library of lints and utilities to define these
|
|
|
|
lints
|
|
|
|
- `macros`: procedural macros to help define a lint
|
|
|
|
|
|
|
|
### `bin`
|
|
|
|
|
2021-10-02 08:22:22 +03:00
|
|
|
This is the main point of interaction between `statix`
|
2021-09-11 18:48:09 +03:00
|
|
|
and the end user. It's output is human-readable and should
|
|
|
|
also support JSON/errorfmt outputs for external tools to
|
|
|
|
use.
|
|
|
|
|
|
|
|
### `lib`
|
|
|
|
|
|
|
|
A library of AST-based lints and utilities to help write
|
|
|
|
those lints. It should be easy for newcomers to write lints
|
|
|
|
without being familiar with the rest of the codebase.
|
|
|
|
|
|
|
|
### `macros`
|
|
|
|
|
|
|
|
This crate intends to be a helper layer to declare lints and
|
|
|
|
their metadata.
|
2021-10-15 10:37:08 +03:00
|
|
|
|
|
|
|
## TODO
|
|
|
|
|
|
|
|
- Offline documentation for each lint
|
|
|
|
- Automatically fix all lints from suggestions generated
|
|
|
|
- Test suite for lints and suggestions
|