A linter and fixer for the Nix programming language that highlights antipatterns and provides automated fixes.
Statix is a linter and fixer for the Nix programming language that identifies antipatterns and provides automated corrections. It helps developers write cleaner, more idiomatic Nix code by highlighting issues like unnecessary assignments or legacy syntax. The tool works purely on the AST level without evaluating Nix code, making it fast and reliable.
Nix developers and infrastructure engineers who write or maintain Nix expressions and want to improve code quality and consistency.
Statix offers a dedicated, fast linter for Nix with automated fixes, unlike general-purpose linters that may not understand Nix-specific patterns. Its integration with `.gitignore` and configurable lint rules make it practical for real-world projects.
lints and suggestions for the nix programming language
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Statix performs pure AST-based checks without evaluating Nix code, making it lightweight and fast for large codebases, as highlighted in its philosophy.
The `fix` command automatically corrects common antipatterns like manual inherit statements, demonstrated in the README examples.
Allows disabling specific lints via a statix.toml file and respects .gitignore by default, easing integration into existing workflows.
Supports JSON and errfmt outputs for easy integration with editors and CI/CD, mentioned in the usage section.
It cannot detect issues related to Nix evaluation, such as missing dependencies or attribute errors, limiting its ability to catch deeper bugs.
Requires Nix flakes or brew for setup, which may be cumbersome for users not already embedded in the Nix ecosystem.
The fixed list of lints may not cover all Nix antipatterns, and development depends on the rnix-parser crate, potentially lagging behind language updates.