From 765a6dda169ecd060f5831fb0dcfe195a26e42bd Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Tue, 4 Nov 2025 16:06:24 -0500 Subject: [PATCH] Add lint-fix make targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds lint-fix and local-lint-fix make targets that automatically fix linting issues using golangci-lint --fix. The implementation reuses the existing hack/lint.sh script by adding support for a "fix" parameter that enables the --fix flag. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Signed-off-by: Tiger Kaovilai --- Makefile | 10 ++++++++++ hack/lint.sh | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/Makefile b/Makefile index 82129623d4..fe28e98484 100644 --- a/Makefile +++ b/Makefile @@ -336,6 +336,16 @@ ifneq ($(SKIP_TESTS), 1) @hack/lint.sh endif +lint-fix: +ifneq ($(SKIP_TESTS), 1) + @$(MAKE) shell CMD="-c 'hack/lint.sh fix'" +endif + +local-lint-fix: +ifneq ($(SKIP_TESTS), 1) + @hack/lint.sh fix +endif + update: @$(MAKE) shell CMD="-c 'hack/update-all.sh'" diff --git a/hack/lint.sh b/hack/lint.sh index 737a6d6750..6b6cdec08c 100755 --- a/hack/lint.sh +++ b/hack/lint.sh @@ -20,6 +20,12 @@ golangci-lint cache status # Enable GL_DEBUG line below for debug messages for golangci-lint # export GL_DEBUG=loader,gocritic,env CMD="golangci-lint run" + +# Add --fix flag if first argument is "fix" +if [ "$1" = "fix" ]; then + CMD="$CMD --fix" +fi + echo "Running $CMD" eval $CMD