-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
treewide: remove isNull where it decreases readability and code understanding #275548
base: master
Are you sure you want to change the base?
Conversation
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.
👎 on this. There's general agreement that it shouldn't be deprecated in NixOS/nix#8264
Edit: Now opened NixOS/nix#9645 to undeprecate it
There's no good reason to deprecate it: - For consistency reasons it should continue to exist, such that all primitive types have a corresponding `builtins.is*` primop. - There's no implementation cost to continuing to have this function - It costs users time to try to migrate away from it, e.g. NixOS/nixpkgs#219747 and NixOS/nixpkgs#275548 - Using it can give easier-to-read code like `all isNull list`
4ad046d
to
c9764f2
Compare
I've changed the PR to only remove it where it decreases readability. Especially |
c9764f2
to
bcd87fe
Compare
Out of all the bad code written in Nixpkgs, this is very far down the list imo. I don't think it's worth doing this. Especially because people will just continue using it regardless. And while this could be automated, it's absolutely not worth the trouble. So really, let's just not worry about this. |
There's no good reason to deprecate it: - For consistency reasons it should continue to exist, such that all primitive types have a corresponding `builtins.is*` primop. - There's no implementation cost to continuing to have this function - It costs users time to try to migrate away from it, e.g. NixOS/nixpkgs#219747 and NixOS/nixpkgs#275548 - Using it can give easier-to-read code like `all isNull list` Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
So we no longer want to fix bad code because people could write new bad code? |
@@ -61,7 +61,7 @@ let | |||
runHook preConfigure | |||
|
|||
${./mix-configure-hook.sh} | |||
${lib.optionalString (!isNull appConfigPath) |
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.
Especially expression like this one shouldn't go through review as they complicate the code a lot.
Description of changes
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.