mattrguerra/cortexmainPrivate on GitHub, published here in full

check-no-em-dash.sh

Language Shell397 B10 lines

scripts/check-no-em-dash.sh

  1. #!/usr/bin/env bash
  2. # House style: no em dashes anywhere in the repository, lockfiles included.
  3. set -euo pipefail
  4. cd "$(dirname "$0")/.."
  5. dash=$(printf '\xe2\x80\x94') # U+2014, built from its bytes so this file does not contain one
  6. if git ls-files -z | xargs -0 grep -nIF -e "$dash" -- 2>/dev/null; then
  7. echo "Em dashes found (above). Rewrite the sentence." >&2
  8. exit 1
  9. fi
  10. echo "no em dashes"