Skip to content

Commit 8f059b7

Browse files
committed
make make pretty actually fix imports
Signed-off-by: Andres Taylor <[email protected]>
1 parent c0e528a commit 8f059b7

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ clean:
4242
# Pretty: formats the code using gofumpt and goimports-reviser
4343
pretty: check-tools
4444
@echo "Running formatting tools..."
45-
@gofumpt -l -w . >/dev/null 2>&1 || true
46-
@goimports-reviser -project-name $$(go list -m) -rm-unused -set-alias -format . >/dev/null 2>&1 || true
45+
@gofumpt -w . >/dev/null 2>&1
46+
@goimports-reviser -recursive -project-name $$(go list -m) -rm-unused -set-alias ./go >/dev/null 2>&1
4747

4848
# Tools installation command
4949
install-tools:

git-hooks/pre-commit

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ for file in $GO_FILES; do
1818
}
1919
done
2020

21-
# 2. Run goimports-reviser to verify formatting on changed files (without writing changes)
22-
echo "Checking goimports-reviser formatting..."
21+
# Check imports with goimports-reviser
22+
echo "Checking goimports-reviser imports..."
2323
for file in $GO_FILES; do
24-
goimports-reviser -project-name $(go list -m) -rm-unused -set-alias -format "$file" -diff >/dev/null 2>&1
24+
goimports-reviser -project-name $(go list -m) -rm-unused -set-alias "$file" >/dev/null 2>&1
2525
if [[ $? -ne 0 ]]; then
26-
echo "Error: Imports not correctly formatted in $file. Please run 'make pretty'."
26+
echo "Error: Imports not correctly organized in $file. Please run 'make pretty'."
2727
exit 1
2828
fi
2929
done

go/summarize/utils_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"testing"
2121

2222
"github.com/stretchr/testify/assert"
23-
2423
"github.com/stretchr/testify/require"
2524
)
2625

0 commit comments

Comments
 (0)