A linter and fixer for Nix code 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 without evaluating Nix code, relying solely on AST analysis for fast and reliable results.
Nix developers and infrastructure engineers who want to maintain high-quality, consistent Nix codebases and automate code improvements.
Statix offers a fast, non-evaluating linter with built-in fix capabilities, making it easy to integrate into development workflows and CI pipelines. Its focus on static analysis ensures reliable performance without the overhead of evaluating complex Nix expressions.
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.
Operates without evaluating Nix code, providing quick linting based solely on the AST from rnix-parser, as noted in the philosophy section.
Can automatically correct common antipatterns, such as converting assignments to inherit statements, demonstrated in the examples with statix fix.
Supports multiple output formats including JSON and errfmt, making it easy to integrate into CI pipelines and editors like vim, as highlighted in the usage section.
Allows disabling specific lints via a statix.toml configuration file with automatic discovery, enabling tailored linting for project needs.
Cannot detect issues that only arise during Nix code evaluation, such as missing imports or dependency errors, limiting its error coverage since it works only with ASTs.
Offers only a predefined list of lints with no extensibility or plugin system for adding custom rules, which may not cover all team-specific or advanced use cases.
Primarily distributed via Nix flakes or package managers like brew, which might be cumbersome for users not already embedded in the Nix ecosystem or preferring simpler installs.