19 lines
454 B
Bash
Executable File
19 lines
454 B
Bash
Executable File
#!/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
|