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

Add a subcommand to verify all dependencies are inherited #2

Open
MarcoIeni opened this issue Mar 20, 2024 · 5 comments · May be fixed by #17
Open

Add a subcommand to verify all dependencies are inherited #2

MarcoIeni opened this issue Mar 20, 2024 · 5 comments · May be fixed by #17
Labels
enhancement New feature or request

Comments

@MarcoIeni
Copy link

It would be great to run this tool in CI to check if there are no duplicate dependencies across the workspace (i.e. all compatible dependencies are inherited).

Something like cargo autoinherit check.

This command should:

  • exit with a non zero status code if there are dependencies that could be inherited.
  • exit with status code zero if all dependencies are inherited

additional feature

There could be an additional flag to forbid dependencies which aren't inherited.
Useful for maintainers who wants to specify all dependencies verdions in the main Cargo.toml

@LukeMathWalker
Copy link
Collaborator

That'd be quite nice!

I would use the same CLI structure of cargo fmt (i.e. cargo autoinherit --check) though.

@LukeMathWalker LukeMathWalker added the enhancement New feature or request label Mar 21, 2024
@MarcoIeni
Copy link
Author

MarcoIeni commented Mar 21, 2024

Yes, I think it's fine 👍
The only downside I see is that there could be confusion if we want to add other flags to the check operation.
We should explain that certain flags only apply if the check flag is passed.

This risk can be mitigated with a configuration file.
I.e. devs specify their desired behavior with the config file instead of flags.

@LukeMathWalker
Copy link
Collaborator

I lean towards having minimal or no configuration options, although it's always difficult to predict the future. A proper sub-command is certainly more flexible.

@ModProg
Copy link

ModProg commented Mar 21, 2024

There could also be a flag to warn on mismatched versions as described in the readme, so they can be resolved manually

@LukeMathWalker
Copy link
Collaborator

There could also be a flag to warn on mismatched versions as described in the readme, so they can be resolved manually

That's already the case—any version conflict is reported in the terminal. We exit with a success status code though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants