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
This commit is contained in:
William Chargin 2018-05-25 19:27:31 -07:00 committed by GitHub
parent ab10e1746c
commit f0fcf02791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -22,6 +22,13 @@ function makeTasks(mode /*: "BASIC" | "FULL" */) {
cmd: ["./scripts/ensure-flow.sh"], cmd: ["./scripts/ensure-flow.sh"],
deps: [], 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", id: "check-pretty",
cmd: ["npm", "run", "--silent", "check-pretty"], cmd: ["npm", "run", "--silent", "check-pretty"],

2
scripts/check-stopships.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
! git grep -n -i "STOP""SHIP" -- :/