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

Recursively lint path-local crates #9

Open
HybridEidolon opened this issue Jan 15, 2016 · 0 comments
Open

Recursively lint path-local crates #9

HybridEidolon opened this issue Jan 15, 2016 · 0 comments

Comments

@HybridEidolon
Copy link

I would like to see an option, such as --recur-local, that checks the dependency list for the current crate and recurs, building a list of dependencies that are path-local, for example:

[dependencies]
subcrate = { path = "subcrate" }
subcrate2 = { path = "subcrate2" }

where each subcrate may have further local dependencies.

After building this list, the command would invoke cargo check -p <dep> on each one and append all the warning output until it reached the top crate.

The use case is in large projects that split their code into trees of crates to reduce iteration time or better organize independent parts. Currently, if you invoke cargo check, the dependencies will only be linted when they need to be recompiled. This hinders the output that parsers like Syntastic or atom-linter have to work with.

Problems with this would be when there's an error in a leaf crate. Because rustc needs rlibs to reference symbols from, if a lower level crate fails to compile, the upper ones can't even be checked with -Zno-trans. Another issue is that invoking cargo rustc or cargo build at all, even with -Zno-trans, causes cargo to delete the existing artifacts for the crate, so lower level crates would have to be recompiled anyway for the full lint.

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

No branches or pull requests

1 participant