Skip to content

Commit 3e9279a

Browse files
committed
fix: resolve govet printf format error and enhance Makefile
- Fix StatusCode format specifier from %s to %c in builtin.go - Add make vet, check, fix targets to Makefile - Enhance lint target with 5m timeout to match CI
1 parent e3c40e7 commit 3e9279a

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build run test clean install lint fmt help
1+
.PHONY: build run test clean install lint fmt vet check fix help
22

33
# Build variables
44
BINARY_NAME=opencode-sync
@@ -55,14 +55,28 @@ deps:
5555
$(GOMOD) download
5656
$(GOMOD) tidy
5757

58+
## vet: Run go vet
59+
vet:
60+
$(GOCMD) vet ./...
61+
5862
## lint: Run linter
5963
lint:
6064
@which golangci-lint > /dev/null || (echo "Installing golangci-lint..." && go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest)
61-
golangci-lint run ./...
65+
golangci-lint run --timeout=5m ./...
6266

6367
## fmt: Format code
6468
fmt:
6569
$(GOFMT) -s -w .
70+
$(GOCMD) fmt ./...
71+
72+
## check: Run all checks (fmt, vet, lint)
73+
check: fmt vet lint
74+
@echo "All checks passed!"
75+
76+
## fix: Auto-fix linting issues where possible
77+
fix:
78+
@which golangci-lint > /dev/null || (echo "Installing golangci-lint..." && go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest)
79+
golangci-lint run --fix --timeout=5m ./...
6680

6781
## build-all: Build for all platforms
6882
build-all: clean

internal/git/builtin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ func (g *BuiltinGit) Diff() (string, error) {
343343
var diff string
344344
for path, fileStatus := range status {
345345
if fileStatus.Worktree != git.Unmodified {
346-
diff += fmt.Sprintf("%s: %s\n", path, fileStatus.Worktree)
346+
diff += fmt.Sprintf("%s: %c\n", path, fileStatus.Worktree)
347347
}
348348
}
349349

0 commit comments

Comments
 (0)