-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
nixos/bat: fix settings type handling #392495
Conversation
b39cfcb
to
5fb3b23
Compare
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.
Hi, welcome to Nixpkgs!
The commit title should be as the PR title (just like I did), please amend and force push.
hii, thank you |
5fb3b23
to
ee299a5
Compare
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.
Seems good to me! Just a small stylistic nit to fit the rest of the module.
nixos/modules/programs/bat.nix
Outdated
recursiveToString = value: | ||
if isList value then | ||
map recursiveToString value | ||
else if builtins.isBool value then |
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.
else if builtins.isBool value then | |
else if isBool value then |
Inherit isBool
from lib
. This is purely stylistic, as we avoid having to call for builtins
.
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.
sure
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.
You also need to add it to the inherit
statement at the top of the file.
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.
done
11fff86
to
f457dc4
Compare
nixos/modules/programs/bat.nix
Outdated
if isList value then | ||
map recursiveToString value | ||
else if isBool value then | ||
if value then "true" else "false" |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@@ -18,6 +18,7 @@ let | |||
nameValuePair | |||
optionalString | |||
types | |||
isBool |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Also, this PR removes enclosing quotes from string values, is that desirable?
f457dc4
to
010f3ea
Compare
okay i have changed it |
is it okay now? @eclairevoyant @SigmaSquadron |
I don't know about removing the quotes. Does Bat still parse everything correctly? |
@SigmaSquadron I asked the same, evidently this handles it: nixpkgs/nixos/modules/programs/bat.nix Line 28 in 010f3ea
I haven't had a chance to test it yet, and I didn't see any tests for the module, perhaps adding some in a future PR would be ideal. |
I'll look into adding tests ~eventually. Shouldn't be much different from other CLI tool tests. |
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.
Manually tested; it does seem to work just fine without quotes. LGTM.
Converts configuration values recursively using
toString
instead of manual quoting while maintaining automatic space-handling through thekeyValue
generator. This supports:Closes #392323
Maintainer: @SigmaSquadron