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

Bug: Inconsistent CLI flags style: --no-tests requires an equal sign, all others use space #1933

Open
LeoniePhiline opened this issue Dec 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@LeoniePhiline
Copy link

LeoniePhiline commented Dec 2, 2024

Description of the issue

Description:

Steps to reproduce:

  1. Intuitively try to use the new --no-tests flag, e.g. --profile ci --no-tests warn.

Expected outcome

--no-tests warn should work just as all the many other nextest flags with values, all of which use a space between flag and value.

Actual result

It fails, with --no-tests requiring =, rather than a space.

Nextest version

cargo-nextest 0.9.85 (d5f93f64f 2024-11-26)
release: 0.9.85
commit-hash: d5f93f64faf6b1d1d425dce52019c14757c7b082
commit-date: 2024-11-26
host: x86_64-unknown-linux-gnu

Additional context

Initially mentioned in #1646 (reply in thread).

@LeoniePhiline LeoniePhiline added the bug Something isn't working label Dec 2, 2024
@sunshowers
Copy link
Member

Thanks for the report! I was wondering if/when someone would notice :)

So a recurring issue for nextest users has been mixing up test name filters and arguments to options. For example, imagine someone specifies --no-tests warn in a script, and a few months later someone changes it to --no-tests fail. But by accident, warn is left in afterwards, so it becomes --no-tests fail warn. All of a sudden, warn will start being interpreted as a test name filter, which is a bit spooky. (This sounds far-fetched, I know, but something very similar to this actually happened once around the --profile option.)

With --no-tests=warn, this has no chance of happening.

At some point I came to the belief that requiring options to be specified with equal signs will end up being less confusing overall -- in hindsight, I think nextest should have started this way, but it's too late to change that now.

So, at that point, it's a matter of consistency with existing options vs not making the confusion worse. I was hoping to lean into the latter, but I definitely see the argument for the former.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants