diff options
author | Michael Gattozzi <mgattozzi@gmail.com> | 2019-12-09 17:42:08 -0500 |
---|---|---|
committer | Michael Gattozzi <mgattozzi@gmail.com> | 2019-12-10 13:17:08 -0500 |
commit | 1dec32c37ac2f563e164021c9f21052f11fd1d20 (patch) | |
tree | 8d5508b09b742e63e72fbbf1571b5667b3ec0e1e /src | |
parent | fcd4ccbec30493872feba137342347541b6a4e28 (diff) |
Make the pre-commit script pedantic and fix errors
This commit really ups the level and quality of the Rust code by setting
clippy to pedantic mode. It also fixes an issue where bash continued to
run scripts even if something failed with a non-zero exit status. We
also deny all warnings so as to actually fail the builds and the commit
hooks. This should make sure code quality stays at a high level.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 7869f4d..a1fac85 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +//! dev-suite cli tool to install and update devsuite and it's tooling use anyhow::{ format_err, Result, @@ -32,9 +33,10 @@ fn main(args: Args) { } } +/// Initialize a git repo with all the tools wanted for it fn init() -> Result<()> { // Make sure we're in a valid git repo - find_root()?; + let _ = find_root()?; let checkboxes = &["hooked - Managed git hooks", "ticket - In repo tickets"]; let defaults = &[true, true]; let selections = Checkboxes::with_theme(&ColorfulTheme::default()) @@ -61,7 +63,7 @@ fn init() -> Result<()> { .map_err(|_| format_err!( "It looks like hooked is not on your $PATH. Did you run 'ds install'?" ))?; - Command::new("hooked").arg("init").spawn()?.wait()?; + let _ = Command::new("hooked").arg("init").spawn()?.wait()?; } Tools::Ticket => { which("ticket") @@ -69,7 +71,7 @@ fn init() -> Result<()> { .map_err(|_| format_err!( "It looks like ticket is not on your $PATH. Did you run 'ds install'?" ))?; - Command::new("ticket").arg("init").spawn()?.wait()?; + let _ = Command::new("ticket").arg("init").spawn()?.wait()?; } } } @@ -77,6 +79,7 @@ fn init() -> Result<()> { Ok(()) } +/// Tools available for installation or usage by dev-suite enum Tools { Hooked, Ticket, |