From 3a6aa7a8fca9cda0aec12765a1aaaf196fe0e64e Mon Sep 17 00:00:00 2001 From: Luxferre Date: Sun, 22 Mar 2026 12:02:17 +0200 Subject: [PATCH] improved tool debugging --- fmt.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 fmt.sh diff --git a/fmt.sh b/fmt.sh new file mode 100755 index 0000000..7f07972 --- /dev/null +++ b/fmt.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# Custom formatter following project guidelines: +# 1. Standard gofmt +# 2. 2-space indentation (expand tabs) +# 3. Report/Check 112-char limit + +FILES=$(find . -name "*.go" -not -path "./bin/*") + +for f in $FILES; do + gofmt -s -w "$f" + expand -t 2 "$f" > "$f.tmp" && mv "$f.tmp" "$f" +done + +LONG_LINES=$(grep -n '.\{113,\}' $FILES) +if [ -n "$LONG_LINES" ]; then + echo "Warning: The following lines exceed 112 characters:" + echo "$LONG_LINES" +fi