-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
What should the CLI look like? #86
Comments
Possible additional operations:
|
To me, at least the "About to publish, please lint all" and the "Checking a PR, advise on semver changes" modes seem different enough to be subcommands rather than flags. That said, I admit that I have only minimal experience designing CLIs, so it's entirely possible I'm missing something obvious. |
I know this is just an example but Isn't this a lint against a a specific snapshot rather than in comparing snapshots? There is also an RFC for this |
It can be phrased and implemented as "no new third-party types leak through compared to the last version" as well, and I'm sure I can come up with more example custom lints that don't have RFCs or whose RFCs have stalled and might not happen. I think In general, though, I'm not sure every lint must always be across snapshots. Some of the lints in #5 are only over the "current" version. I'm not sure how to best make that work in the CLI, but the query engine can run those queries just fine — in |
Isn't that what clippy is for? How do we draw the line for what belongs in clippy vs cargo-semver-check |
I don't think it has to be an either-or. Some lints are easier to write in clippy, some will be easier to write as Trustfall queries, and let users pick what is best for their use case. Overlap in capabilities isn't necessarily bad, in my opinion. An argument against "just let users write their custom lints through clippy" is that they could have done so already, but haven't because of the complexity and learning curve. Multiple people I spoke to within a few days or RustConf were excited at the idea of writing lints as custom queries because it would lower the barrier to entry and make more lints worth implementing. If you don't think But I do think that "here's one tool you can run to make sure you're ready to publish" is a better user story than "here are N tools you should run before you publish, which under the hood function very similarly." Custom lints are just one more thing that maintainers want to check before publishing. Which gives me a tool name idea: |
A couple of angles on this
I can see creating a stop gap tool for user-driven lints until clippy supports it (if they ever do). |
I have no strong preference one way or the other, but I am curious whether you think custom queries in general should be in scope. They can easily be called altogether out of scope, so long as |
I see value in supporting custom queries in the long term for clippy and semver-checks. Stablizing the format for doing custom queries could take some time though. I can see support for them existing behind an unstable CLI flag. |
Thanks for this great tool. It would be great to use it non-published crates and testing features branches for breaking changes against main/master. Something like |
This was being tracked in #51 and was implemented in #87. You can pass the Now, for the action to support it, that is different. If you have a need for more configuration there, I'd recommend creating an issue against the action. |
After speaking to users, I've changed my mind on this. I think we'd be better off deprecating (and eventually, in the merge into cargo, removing) the I'd propose making Here's the current CLI + some possible additions, in part inspired by
|
The Similarly, I think a bigger distinction in the names of rustdoc generation would be a good change. For example, it's not clear when to pass Also, I'm currently thinking about making a PR to add rustdoc generation of current version from the registry, similar to the baseline one. It would allow to easily use the tool for data gathering of previous releases (and would shorten the code of #207). Going with this idea, why don't we support the same types of rustdoc generations in current as in the baseline? That would align with the idea of prefixing the commands with |
Whenever a flag is doing something that cargo itself does as well, it should have the same name as the corresponding flag in cargo to make the merge easier (#61). Otherwise, we'd be forcing users to learn different flags for different cargo commands, which isn't a good idea.
Keep in mind that we shouldn't just flat-out remove and rename any flag, because that would be quite annoying to our users. A better process would be to deprecate the flag, add the new flag, and allow users a reasonable amount of time to switch their scripts and workflows to the new flag.
This is fair. Can we help users understand the "current vs baseline" concept somehow? For example, with a better README, or with better
That's fine by me. Just keep in mind that Another option, if you're interested in adding it, is to allow combinations of We also don't have any test cases for most of these flags, which would be another great thing to add, perhaps in a style similar to our existing GitHub Actions tests on real-world codebases. |
The renaming can be done during the removal of |
I still feel it would be confusing to have some but not all flags mirrored between I'd rather save the hard renames for the actual merge into cargo, at which point the tool itself might get renamed too (#47). |
atm all that is supported is "report what isn't compatible with the current version vs the base version", right? How do we plan to handle the other use cases? I believe resolving that was the main blocker for settling on the CLI. |
That's right.
I think an approach similar to A rough draft example:
I think this is better since each of the commands would be simpler to understand, and would simplify the merge into cargo since it would be more in line with cargo's current approach anyway. It would also avoid the issue of users running What do you think? |
If this is a "experiment and see", then I'm fine. If its "the answer" and closes this PR, then I'm not. I would want to see at least prototypes of the above for us to see how it works in practice and to experiment with alternatives. |
Here's what I'd propose for right now:
What do you think? |
Sounds good. |
Current, everything is under
cargo semver-checks check-release
. Deeply nested subcommands like that should be in rare cases and we should be cautious of having long command names like that.Do we need that extra subcommand? Is there another way of expressing that idea?
Let's first breakdown expected workfows (which will help with #47).
The overall aim is to help with API evolution,. including
The text was updated successfully, but these errors were encountered: