nix-linter
nix-linter copied to clipboard
Implement all ideas from NixOS/ofborg#245
From https://github.com/NixOS/ofborg/issues/245#issuecomment-530601486:
Here are some other occasions I repeatedly comment on:
- [ ] When known build tool/setup hook is in buildInputs instead of nativeBuildInputs
-
- cmake, ninja, meson, autoconf, automake, libtool, intltool, gettext, appstream-glib, gobject-introspection, wrapGAppsHook, wrapQtAppsHook…
- [ ] When a patch is added to patches but no comment describing it is nearby.
- [ ] When using improbable package variant (e.g. gtk3-x11 – here we could check if the source actually depends on this rather than gtk3)
- [ ] When patch file is added to nixpkgs (suggest fetchpatch)
- [ ] When fetching from git with rev=${commithash} but ${version} ≠ unstable-yyyy-mm-dd
- [ ] When fetching from git with rev=refs/tags/${version} (replace with rev=${version})
- [ ] When name="foo-${version}" is used. Suggest pname
- [ ] When unquoted URLs are used (NixOS/rfcs#45, not nixpkgs specific)
- [ ] When hardcoded phases like buildPhase or installPhase invoking make are used (suggest makeFlags)
- [ ] When hardcoded phases are used but they lack runHook
For new packages:
- [ ] Check that meta.maintainers is present
- [ ] Check that meta.license is present
- [ ] Check that meta.platforms is present
These are all good ideas, but they are also mostly nixpkgs-specific. All of the currently specified checks are not specific to any Nix project, but general to any Nix project.
The discourse thread is perhaps also very nixpkgs-specific, but wanted to leave a breadcumb trail that I mentioned this in https://discourse.nixos.org/t/avoiding-targets-of-past-treewide-fixes/5494