The amount of person-hours we currently waste on manually reviewing things which could be automated is not okay. The advantages of automated code quality checking:
- It reduces the amount of back and forth between author and reviewer, because a lot of fixes can be done locally already. This reduces stress and is faster due to having a lower round trip latency.
- It reduces the amount of nitpicky review comments, increasing the signal-to-noise ratio for actually important review comments.
- Higher quality pull requests, which allows reviews to directly focus on the important parts, which is more efficient.
- Having a guaranteed minimum code quality would give us more trust in distributing merge rights to more people, as discussed in More granular commit access control via merge bot
I already dedicated a lot of time last year onto getting Nixpkgs auto-formatted for this exact reason, but the other half of the equation is to have a good and powerful linter.
I think that a linter for Nixpkgs should meet the following requirements:
- Being able to run locally, with fast iteration times
- Provide good error messages and feedback about what should be done
- A powerful architecture that allows to express various kinds of rules. Static analysis is a must, evaluation-based linting would be a welcome addition
- Commit message linting
- Easily extensible; People should be able to add new lints for things that come up frequently
- Granular configuration, especially for the transition phase
- Tooling integration, e.g. with GitHub warnings or IDE extensions
There are already projects who tackle this problem, so we won’t start at zero. What we currently need is a group of people who dedicate themselves to that goal and actively push things forward. An RFC might be a good tool for that, or a working group.