From c3608c101b8d2f7452fb76c6c7ffde446db2f81f Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Mon, 4 May 2020 17:45:09 +0000 Subject: [PATCH] Enforce 80 characters limit in `make check` --- Makefile | 1 + scripts/linewidth.sh | 5 +++++ 2 files changed, 6 insertions(+) create mode 100755 scripts/linewidth.sh diff --git a/Makefile b/Makefile index c31eb29..470270d 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,7 @@ test: check: crystal tool format --check ./bin/ameba + ./scripts/linewidth.sh install: cp mango $(INSTALL_DIR)/mango diff --git a/scripts/linewidth.sh b/scripts/linewidth.sh new file mode 100755 index 0000000..7f76fcb --- /dev/null +++ b/scripts/linewidth.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ ! -z "$(grep '.\{80\}' --exclude-dir=lib --include="*.cr" -nr --color=always . | tee /dev/tty)" ] \ + && echo "The above lines exceed the 80 characters limit" \ + || exit 0