Repository: o0Ignition0o/cargo-scout (language: rust)

Issue:
pass --all-features to clippy
cargo-scout should be allowed to be passed --all-features and pass it to clippy

A live stream on how to fix #11, which almost requires the same steps as fixing this issue is available here https://youtube.com/watch?v=vrCuCnHYep0 :)

If someone would like to work on it, please let me know and I'll do anything I can to ease the process 🎉 


Discussion / hints:
@o0Ignition0o , I'll take this one. Thanks!
Wow awesome :D If you have any question please let me know :)
Thanks, I will. Btw, it's not possible to send you a message on twitter :)

oh thats weird ! I'm sending you a dm! 

Fix patch:
diff --git a/src/clippy.rs b/src/clippy.rs
index dcd9c10..7cd38ab 100644
--- a/src/clippy.rs
+++ b/src/clippy.rs
@@ -47,6 +47,7 @@ pub struct Span {
 pub struct Linter {
     verbose: bool,
     no_default_features: bool,
+    all_features: bool,
 }
 
 impl Linter {
@@ -54,6 +55,7 @@ impl Linter {
         Self {
             verbose: false,
             no_default_features: false,
+            all_features: false,
         }
     }
 
@@ -67,6 +69,11 @@ impl Linter {
         self
     }
 
+    pub fn set_all_features(&mut self, all_features: bool) -> &mut Self {
+        self.all_features = all_features;
+        self
+    }
+
     pub fn get_lints(&self) -> Result<Vec<Lint>, crate::error::Error> {
         self.clippy().map(|output| lints(&output))
     }
@@ -79,6 +86,9 @@ impl Linter {
         if self.no_default_features {
             params.push("--no-default-features");
         }
+        if self.all_features {
+            params.push("--all-features");
+        }
         params.append(&mut vec!["--", "-W", "clippy::pedantic"]);
         params
     }
@@ -217,6 +227,24 @@ mod tests {
             no_default_features_command_parameters,
             no_default_features_linter.get_command_parameters()
         );
+
+        let all_features_linter = linter
+            .set_verbose(false)
+            .set_no_default_features(false)
+            .set_all_features(true);
+        let all_features_command_parameters = vec![
+            "clippy",
+            "--message-format",
+            "json",
+            "--all-features",
+            "--",
+            "-W",
+            "clippy::pedantic",
+        ];
+        assert_eq!(
+            all_features_command_parameters,
+            all_features_linter.get_command_parameters()
+        );
     }
     #[test]
     fn test_lints() {
diff --git a/src/main.rs b/src/main.rs
index e7ef799..8fd193c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -16,10 +16,12 @@ struct Options {
     #[structopt(short = "v", long = "verbose")]
     /// Set the verbosity level
     verbose: bool,
-
     #[structopt(long = "no-default-features")]
     /// Pass the no default features flag to clippy
     no_default_features: bool,
+    #[structopt(long = "all-features")]
+    /// Pass the all features flag to clippy
+    all_features: bool,
     #[structopt(
         short = "b",
         long = "branch",
@@ -56,6 +58,7 @@ fn main() -> Result<(), error::Error> {
     let clippy_lints = clippy::Linter::new()
         .set_verbose(opts.verbose)
         .set_no_default_features(opts.no_default_features)
+        .set_all_features(opts.all_features)
         .get_lints()?;
 
     let warnings_caused_by_diff =


Test patch: