From c1c8cca8779012e4f7262bd3e85ef05f872ec14e Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Wed, 27 Jan 2021 04:18:47 +0000 Subject: [PATCH] Use Ameba to enforce max line width Didn't know Ameba supports this! --- .ameba.yml | 5 +++++ Makefile | 1 - dev/linewidth.sh | 5 ----- 3 files changed, 5 insertions(+), 6 deletions(-) delete mode 100755 dev/linewidth.sh diff --git a/.ameba.yml b/.ameba.yml index e61b3b3..163c936 100644 --- a/.ameba.yml +++ b/.ameba.yml @@ -7,3 +7,8 @@ Lint/UnusedArgument: - src/routes/* Metrics/CyclomaticComplexity: Enabled: false +Layout/LineLength: + Enabled: true + MaxLength: 80 + Excluded: + - src/routes/api.cr diff --git a/Makefile b/Makefile index d9485c5..6c5eebf 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,6 @@ test: check: crystal tool format --check ./bin/ameba - ./dev/linewidth.sh arm32v7: crystal build src/mango.cr --release --progress --error-trace --cross-compile --target='arm-linux-gnueabihf' -o mango-arm32v7 diff --git a/dev/linewidth.sh b/dev/linewidth.sh deleted file mode 100755 index 6e83fbc..0000000 --- a/dev/linewidth.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -[ ! -z "$(grep '.\{80\}' --exclude-dir=lib --include="*.cr" -nr --color=always . | grep -v "routes/api.cr" | tee /dev/tty)" ] \ - && echo "The above lines exceed the 80 characters limit" \ - || exit 0