Exclude vendor directory from format checks
This commit is contained in:
4
Makefile
4
Makefile
@@ -10,12 +10,12 @@ check: fmt-check lint test
|
|||||||
# Check formatting without modifying files
|
# Check formatting without modifying files
|
||||||
fmt-check:
|
fmt-check:
|
||||||
@echo "Checking formatting..."
|
@echo "Checking formatting..."
|
||||||
@test -z "$$(gofmt -l .)" || (echo "Files need formatting:"; gofmt -l .; exit 1)
|
@test -z "$$(gofmt -l . | grep -v '^vendor/')" || (echo "Files need formatting:"; gofmt -l . | grep -v '^vendor/'; exit 1)
|
||||||
|
|
||||||
# Format code
|
# Format code
|
||||||
fmt:
|
fmt:
|
||||||
@echo "Formatting code..."
|
@echo "Formatting code..."
|
||||||
gofmt -w .
|
gofmt -w $$(find . -name '*.go' -not -path './vendor/*')
|
||||||
|
|
||||||
# Run linter
|
# Run linter
|
||||||
lint:
|
lint:
|
||||||
|
|||||||
Reference in New Issue
Block a user