-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check-meta: fix hasNoMaintainers
for missing maintainers
attr
#357674
base: master
Are you sure you want to change the base?
Conversation
hasNoMaintainers
for missing maintainers
attr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM in principle. I assume length (attrs.meta.maintainers or [ ]) == 0
is probably bad for eval perf or something.
This will pick up things like the majority of trivial builders etc. that have no meta
, I don’t know if that’s a concern. It might even complain about fetchers? That might be why it’s like that currently.
Could add a check if it's got
Yeah, maybe doing a |
@emilazy in my (probably naive) testing with hyperfine, they're ~equivalent in terms of speed:
Where:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting changes for simplification.
Previously, when meta.maintainers wasn't defined, hasNoMaintainers would return false, since it relied on its presence to check for its length. Now, it returns true.
cb115fe
to
e4945ac
Compare
Thanks all for the "code golfing" 😅 In my testing with hyperfine (see above), all solutions were basically equivalent in terms of run time (haven’t tested memory usage though). I still ended up implementing @zimbatm's suggestion, since it's much clearer than my first attempt, and avoids a function call. Still, we haven't addressed the issue of false positives with fetchers & co. @RossComputerGuy could you expand on what you mean by
|
I'm not sure what the CI failure is about... |
Yes, I think we're changing the previous semantics of 4def222. |
|
@RossComputerGuy thanks for the pointer (turns out the correct attr was
I believe hooks as well, since they're not FODs. |
At which point it would be more helpful to check for version or src to confirm it is a package. |
Changing the code to hasNoMaintainers = attrs: attrs ? src && attrs.meta.maintainers or [ ] == [ ]; and building the
full output
|
Are we slowly but surely circling back to checking for meta? |
I like the idea of weakening |
Problem is that (at least some) hooks have
I don't understand why they do though, given how they're defined: 1 2. |
Well, perhaps hooks ought to have maintainers… |
@emilazy I mean I don't disagree (at all, in fact), but how to go about that? Seems like complexity explosion, from a 1-liner to an fuzzily defined social problem 😅 |
It’s an off‐by‐default warning, right? There’s a lot of stuff in the tree with no maintainers already. Warning about more of it only seems bad if it’s stuff that we don’t care about the maintainers for (like fetcher calls); for hooks it seems okay to me personally. |
Previously, when
meta.maintainers
wasn't defined,hasNoMaintainers
would return false, since it relied on its presence to check for its length.Now, it returns true, which seems more logical.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.