Enforce 80 characters limit in make check

This commit is contained in:
Alex Ling 2020-05-04 17:45:09 +00:00
parent 1bec9f0108
commit c3608c101b
2 changed files with 6 additions and 0 deletions

View File

@ -25,6 +25,7 @@ test:
check: check:
crystal tool format --check crystal tool format --check
./bin/ameba ./bin/ameba
./scripts/linewidth.sh
install: install:
cp mango $(INSTALL_DIR)/mango cp mango $(INSTALL_DIR)/mango

5
scripts/linewidth.sh Executable file
View File

@ -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