jtojnar / nixpkgs-hammering

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

attribute-typo: whitelist CPPFLAGS #86

Closed SuperSandro2000 closed 3 years ago

SuperSandro2000 commented 3 years ago
nixpkgs-hammer python37 --exclude attribute-ordering
When evaluating attribute ‘python37’:
warning: attribute-typo
A likely typo in `CPPFLAGS` argument was found, did you mean `CFLAGS` or `CXXFLAGS`?

Near /home/hotpi/.cache/nixpkgs-review/pr-114530-3/nixpkgs/pkgs/development/interpreters/python/cpython/default.nix:242:3:
    |
242 |   CPPFLAGS = concatStringsSep " " (map (p: "-I${getDev p}/include") buildInputs);
    |   ^
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/attribute-typo.md
rmcgibbo commented 3 years ago

Maybe it should go here: https://github.com/jtojnar/nixpkgs-hammering/blob/ae7c353478126ebaa8962a1e5d92c70333e3550d/lib/derivation-attributes.nix#L53?

jtojnar commented 3 years ago

I guess semantically, it should go before CFLAGS and CXXFLAGS since CPPFLAGS are for the preproccessor while the former are for the compiler? But not sure if we should care about this level of distinction. cc @worldofpeace

SuperSandro2000 commented 3 years ago

I would just sort those array alphabetically and be done with it.

worldofpeace commented 3 years ago

@jtojnar Yeah, I think it's not super important to have that level of distinction. Alphabetical would be just fine.