aboutsummaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorMichael Gattozzi <mgattozzi@gmail.com>2019-12-09 17:42:08 -0500
committerMichael Gattozzi <mgattozzi@gmail.com>2019-12-10 13:17:08 -0500
commit1dec32c37ac2f563e164021c9f21052f11fd1d20 (patch)
tree8d5508b09b742e63e72fbbf1571b5667b3ec0e1e /shared
parentfcd4ccbec30493872feba137342347541b6a4e28 (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 'shared')
-rw-r--r--shared/src/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/shared/src/lib.rs b/shared/src/lib.rs
index 138e8d0..db28822 100644
--- a/shared/src/lib.rs
+++ b/shared/src/lib.rs
@@ -1,3 +1,5 @@
+//! Common functionality needed in many of the tools
+
use anyhow::{
bail,
Result,
@@ -7,6 +9,7 @@ use std::{
path::PathBuf,
};
+/// Finds the top level folder of the repo and returns it's canonicalized path
pub fn find_root() -> Result<PathBuf> {
let mut location = env::current_dir()?;
let mut found_root = false;
@@ -14,7 +17,7 @@ pub fn find_root() -> Result<PathBuf> {
for loc in location.ancestors() {
let mut loc = loc.join(".git");
if loc.exists() {
- loc.pop();
+ let _ = loc.pop();
found_root = true;
location = loc.canonicalize()?;
break;