jtojnar / nixpkgs-hammering

Beat your package expressions into a shape
MIT License
241 stars 15 forks source link

Proposed hammer: Prefer `''${ENV_VAR}` over `${ENV_VAR}` #142

Open pbsds opened 9 months ago

pbsds commented 9 months ago

This is for the sake of overrideability

Such a lint/hammer would catch this test case, which is broken:

(mkDerivation rec {
  ...
  BUILD_COMMAND = "production";
  buildPhase = ''
    npm run "${BUILD_COMMAND}"
  '';
}).overrideAttrs (_: {
  BUILD_COMMAND="development";
})