From f0fcf0279149bcbdf5e463d183d2f0ade2f2d635 Mon Sep 17 00:00:00 2001 From: William Chargin Date: Fri, 25 May 2018 19:27:31 -0700 Subject: [PATCH] Check for STOPSHIPs in CI (#301) Summary: Placing `STOPSHIP` or `stopship` (or any case variant) in any file tracked by Git will now cause a `yarn travis` failure. If you need to use this string, you can concatenate it as `"stop" + "ship"` or equivalent. Test Plan: In `travis.js`, change `"check-stop" + "ships"` to `"check-stopships"`, and note that this causes the build to fail with a nice message. Note that this also causes `check-stopships.sh` to fail even when invoked from an unrelated directory, like `src`. wchargin-branch: check-stopships --- config/travis.js | 7 +++++++ scripts/check-stopships.sh | 2 ++ 2 files changed, 9 insertions(+) create mode 100755 scripts/check-stopships.sh diff --git a/config/travis.js b/config/travis.js index be308d4..7daa485 100644 --- a/config/travis.js +++ b/config/travis.js @@ -22,6 +22,13 @@ function makeTasks(mode /*: "BASIC" | "FULL" */) { cmd: ["./scripts/ensure-flow.sh"], deps: [], }, + { + // eslint-disable-next-line no-useless-concat + id: "check-stop" + "ships", + // eslint-disable-next-line no-useless-concat + cmd: ["./scripts/check-stop" + "ships.sh"], + deps: [], + }, { id: "check-pretty", cmd: ["npm", "run", "--silent", "check-pretty"], diff --git a/scripts/check-stopships.sh b/scripts/check-stopships.sh new file mode 100755 index 0000000..4380ab7 --- /dev/null +++ b/scripts/check-stopships.sh @@ -0,0 +1,2 @@ +#!/bin/sh +! git grep -n -i "STOP""SHIP" -- :/