Nixf-tidy: static/semantic linter for nix, help me to integrate it with Github Actions (PR Reviews?)

libnixf already addresses some points here:

Being able to run locally, with fast iteration times

Yes.

Provide good error messages and feedback about what should be done

Yes. Fixes are available even for missing */ for closing comments.

A powerful architecture that allows to express various kinds of rules.

Not so much, currently all static lintings are written in C++.

Static analysis is a must, evaluation-based linting would be a welcome addition

libnixf could transform it’s AST to nix::Expr * expression, thus it can evaluate the code.

Commit message linting

Not implemented, but I suppose it should based on eval results / AST-diff ?

Easily extensible; People should be able to add new lints for things that come up frequently

Not so much. Please write rules / feature requests and I would like to impl it, in C++.

Granular configuration, especially for the transition phase

Just run nixf-tidy on git-diff only.

Tooling integration, e.g. with GitHub warnings or IDE extensions

Yes. libnixf is the frontend of nixd. That is, rules implemented in libnixf works out of box for nixd users. As a language server integrated to your editors (e.g. vscode/nvim/…) .

2 Likes