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

cargo clippy does not process build scripts #2802

Open
FaultyRAM opened this issue May 27, 2018 · 3 comments
Open

cargo clippy does not process build scripts #2802

FaultyRAM opened this issue May 27, 2018 · 3 comments

Comments

@FaultyRAM
Copy link

FaultyRAM commented May 27, 2018

cargo clippy doesn't do any extra handling of build scripts beyond what cargo check does. For example, this code will trigger an unknown_lints warning when using cargo clippy:

#![forbid(print_literal)]

fn main() {
    println!("{}", "");
}

Built-in lints still work; adding a #![forbid(missing_docs)] to the above snippet fails the build as expected. clippy-as-a-plugin also works:

#![feature(plugin)]
#![plugin(clippy)]
#![forbid(print_literal)]

fn main() {
    println!("{}", "");
}

I'm not actually sure whether clippy or cargo is at fault here, but since the plugin interface is about to go I figured it might be more prudent to report here first.

@flip1995
Copy link
Member

I'm currently working on tool_lints (rust-lang/rust#44690), which will allow to just write #![forbid(clippy::print_literal)]. This should solve this problem.

@lopopolo
Copy link

@flip1995 I noticed this issue has no tags. Does that mean it is not prioritized?

lopopolo added a commit to artichoke/artichoke that referenced this issue Aug 20, 2019
Clippy does not lint build scripts See rust-lang/rust-clippy#2802
@Manishearth
Copy link
Member

No. Not all issues fit cleanly in the labeled buckets.

This in particular is something that would require #3837 to be finished

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

4 participants