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

Issue:
Diff against HEAD by default instead of master
As mentioned by @ebroto [in this comment](https://github.com/o0Ignition0o/cargo-scout/pull/74#issuecomment-573458734_), it would probably make much more sense to diff against HEAD instead of master by default.

It would require us to change [the default value of the branch option](https://github.com/o0Ignition0o/cargo-scout/blob/master/cargo-scout/src/main.rs#L27) from master to HEAD.

We would probably need to update the README.md file, and perhaps some documentation and tests as well.


Discussion / hints:
Taking it!
Yay thanks for doing it ! 🎉 

Fix patch:
diff --git a/README.md b/README.md
index e10deb7..bc59a35 100644
--- a/README.md
+++ b/README.md
@@ -57,7 +57,7 @@ The linter uses [clippy](https://github.com/rust-lang/rust-clippy) and the forma
 
 Rust nightly: Some commands require a nightly edition of rust, because the features we use aren't available in stable yet ([rustfmt --emit json](https://github.com/rust-lang/rustfmt/issues/3947) and some [cargo clippy features in a workspace setting](https://github.com/rust-lang/cargo/issues/4942)).
 
-We try to keep a close eye to the relevant tracking issues and hope we can switch it to stable soon. If the issues evolved and we didn't notice, please file an issue and let us know !
+We try to keep a close eye to the relevant tracking issues and hope we can switch it to stable soon. If the issues evolved and we didn't notice, please file an issue and let us know!
 
 
 ## How to install
@@ -69,8 +69,8 @@ $ cargo install cargo-scout
 
 Open a shell, go to the project you would like to run the command in, and run cargo-scout, with an optional target branch:
 ```bash
-$ cargo-scout lint # clippy::pedantic lints on a diff with master
-$ cargo-scout fmt # rustfmt lints on a diff with master
+$ cargo-scout lint # clippy::pedantic lints on a diff with HEAD
+$ cargo-scout fmt # rustfmt lints on a diff with HEAD
 ```
 
 Each command and subcommand supports -h and --help:
diff --git a/cargo-scout-lib/src/config/rust.rs b/cargo-scout-lib/src/config/rust.rs
index 6126d2a..90f2f74 100644
--- a/cargo-scout-lib/src/config/rust.rs
+++ b/cargo-scout-lib/src/config/rust.rs
@@ -40,6 +40,7 @@ impl CargoConfig {
     /// assert_eq!(vec!["cargo-scout".to_string(), "cargo-scout-lib".to_string()], config.members());
     /// # Ok::<(), cargo_scout_lib::Error>(())
     /// ```
+    #[allow(clippy::missing_errors_doc)]
     pub fn from_manifest_path(p: impl AsRef<Path>) -> Result<Self, crate::error::Error> {
         Ok(Self::from_manifest(cargo_toml::Manifest::from_path(p)?))
     }
diff --git a/cargo-scout-lib/src/linter/mod.rs b/cargo-scout-lib/src/linter/mod.rs
index 1b9e592..3005d72 100644
--- a/cargo-scout-lib/src/linter/mod.rs
+++ b/cargo-scout-lib/src/linter/mod.rs
@@ -4,6 +4,7 @@ pub mod clippy;
 pub mod rustfmt;
 
 pub trait Linter {
+    #[allow(clippy::missing_errors_doc)]
     fn lints(&self, working_dir: impl Into<PathBuf>) -> Result<Vec<Lint>, crate::error::Error>;
 }
 
diff --git a/cargo-scout-lib/src/scout/mod.rs b/cargo-scout-lib/src/scout/mod.rs
index 695b1f2..088fd1e 100644
--- a/cargo-scout-lib/src/scout/mod.rs
+++ b/cargo-scout-lib/src/scout/mod.rs
@@ -27,6 +27,7 @@ where
             linter,
         }
     }
+    #[allow(clippy::missing_errors_doc)]
     pub fn run(&self) -> Result<Vec<Lint>, crate::error::Error> {
         let current_dir = std::fs::canonicalize(std::env::current_dir()?)?;
         let diff_sections = self.vcs.sections(current_dir.clone())?;
diff --git a/cargo-scout-lib/src/vcs/git.rs b/cargo-scout-lib/src/vcs/git.rs
index 348a3f5..f598754 100644
--- a/cargo-scout-lib/src/vcs/git.rs
+++ b/cargo-scout-lib/src/vcs/git.rs
@@ -12,7 +12,7 @@ impl Default for Git {
     #[must_use]
     fn default() -> Self {
         Self {
-            target_branch: "master".to_string(),
+            target_branch: "HEAD".to_string(),
         }
     }
 }
diff --git a/cargo-scout-lib/src/vcs/mod.rs b/cargo-scout-lib/src/vcs/mod.rs
index 3976e61..9203370 100644
--- a/cargo-scout-lib/src/vcs/mod.rs
+++ b/cargo-scout-lib/src/vcs/mod.rs
@@ -3,6 +3,7 @@ use crate::error::Error;
 use std::path::Path;
 
 pub trait VCS {
+    #[allow(clippy::missing_errors_doc)]
     fn sections<P>(&self, repo_path: P) -> Result<Vec<Section>, Error>
     where
         P: AsRef<Path>;
diff --git a/cargo-scout/src/main.rs b/cargo-scout/src/main.rs
index 59b6802..9c1ae0a 100644
--- a/cargo-scout/src/main.rs
+++ b/cargo-scout/src/main.rs
@@ -24,7 +24,7 @@ struct FmtOptions {
         short = "b",
         long = "branch",
         value_name = "branch",
-        default_value = "master"
+        default_value = "HEAD"
     )]
     /// Set the target branch
     branch: String,
@@ -54,7 +54,7 @@ struct LintOptions {
         short = "b",
         long = "branch",
         value_name = "branch",
-        default_value = "master"
+        default_value = "HEAD"
     )]
     /// Set the target branch
     branch: String,


Test patch: