Skip to content
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

Option names passed to statix are missing dashes #505

Closed
adomixaszvers opened this issue Oct 11, 2024 · 0 comments · Fixed by #506
Closed

Option names passed to statix are missing dashes #505

adomixaszvers opened this issue Oct 11, 2024 · 0 comments · Fixed by #506

Comments

@adomixaszvers
Copy link

Changes made in #503 introduced a call to lib.cli.toGNUCommandLineShell but it does not call mkOption on names so they are without dashes. I have reproduced the issue with expression

{
  pkgs ? import <nixpkgs> { },
}:
let
  inherit (pkgs) lib;
  settings = {
    format = [ "errfmt" ];
    ignore = [ "hardware-config.nix" ];
  };
in
{
  goodOptions = lib.cli.toGNUCommandLineShell { } settings;
  badOptions = lib.cli.toGNUCommandLineShell {
    mkList = name: value: [ name ] ++ lib.unique value;
  } settings;
}

.
Here goodOptions evaluates to '--format' 'errfmt' '--ignore' 'hardware-config.nix' and badOptions to 'format' 'errfmt' 'ignore' 'hardware-config.nix'.

@adomixaszvers adomixaszvers changed the title Options passed to statix are missing dashes Option names passed to statix are missing dashes Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant