aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml1
-rwxr-xr-xetc/ci/check_no_unwrap.sh15
2 files changed, 16 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
index 4872e5de094..9f591aa3519 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,6 +16,7 @@ matrix:
- ./mach test-compiletest
- bash etc/ci/lockfile_changed.sh
- bash etc/ci/manifest_changed.sh
+ - bash etc/ci/check_no_unwrap.sh
cache:
directories:
- .cargo
diff --git a/etc/ci/check_no_unwrap.sh b/etc/ci/check_no_unwrap.sh
new file mode 100755
index 00000000000..bbf5eabce88
--- /dev/null
+++ b/etc/ci/check_no_unwrap.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+#
+# Make sure listed files do not contain "unwrap"
+set -o errexit
+set -o nounset
+set -o pipefail
+
+cd $(git rev-parse --show-toplevel) # cd into repo root so make sure paths works in any case
+
+# files that should not contain "unwrap"
+FILES=("components/compositing/compositor.rs"
+ "components/compositing/pipeline.rs"
+ "components/compositing/constellation.rs")
+
+! grep -n "unwrap(" "${FILES[@]}"