-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Describe the problem you are trying to solve
I often run the same commands over and over with the same set of flags (--all-features
, --all-targets
, --deny warnings
). Then I found out about the .cargo/config
and the [alias]
section. So I thought about doing a recursive alias (like I would do with aliases in a shell).
[alias]
clippy = "clippy --workspace --all-features --all-targets -- --deny warnings"
But this is not possible as it is shadowing the existing clippy
command. Actually, it might even be a bug because this is what I get when I'm trying to do that.
$> cargo clippy
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
[1] 2198266 abort (core dumped) cargo clippy
Describe the solution you'd like
Like aliases in a shell, I'd expect the alias
defined above to just work when typing cargo clippy
.
One nice advantage would be that all the project's contributors would follow the same configuration for the project (including the CI).
Notes
I'm throwing the idea but I'm also aware of the weirdness in a recursive definition. It might not be desirable.
Another possible drawback: it might be harder to use the original clippy
command. For example, in shell, if we had an alias ls="ls -l"
, we could use the original command (and therefore deactivate the -l
option) by doing /usr/bin/ls
. Not sure how to reproduce a similar behavior with cargo
.
Related issues
#2901
Activity
nipunn1313 commentedon Aug 7, 2021
@rustbot claim
ehuss commentedon Aug 18, 2021
Closing this as resolved by #9791.