summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-11-22 06:31:42 +0000
committerLars Wirzenius <liw@liw.fi>2020-11-22 06:31:42 +0000
commit9674e8c8a420abe5188fc445556e4a50e4d721d3 (patch)
treeed39dc98fb517153b83e15fd6f5a0270d6eb9753
parentaafde793b3d88388364de043a7cece4ce4308006 (diff)
parent0493559145e5a6632ea605cb71662a36ec727259 (diff)
downloadobnam2-9674e8c8a420abe5188fc445556e4a50e4d721d3.tar.gz
Merge branch 'check' into 'main'
fix: run cargo clippy, fmt only if available See merge request larswirzenius/obnam!16
-rwxr-xr-xcheck9
1 files changed, 7 insertions, 2 deletions
diff --git a/check b/check
index 0dc71cc..65514cc 100755
--- a/check
+++ b/check
@@ -16,9 +16,14 @@ then
esac
fi
+got_cargo_cmd()
+{
+ cargo --list | grep " $1 " > /dev/null
+}
+
cargo build --all-targets $quiet
-cargo clippy $quiet
-cargo fmt -- --check
+got_cargo_cmd clippy && cargo clippy $quiet
+got_cargo_cmd fmt && cargo fmt -- --check
$hideok cargo test $quiet
sp-docgen obnam.md -o obnam.html