make: add `lint-native` target for running linter without Docker
What changed, and why it matters
This commit only adds a new optional Makefile target that lets developers run the project's Go linter directly on their computer instead of inside a Docker container. It does not change any application code, network behavior, or security-sensitive logic. There is no indication this introduces a vulnerability.
No security action required. This is a build/tooling convenience change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds build-native-linter and lint-native targets to the LND Makefile. lint-native compiles the custom golangci-lint binary from tools/ using go tool golangci-lint custom, then runs it with GOWORK=off and --new-from-rev=$(git merge-base HEAD master) to lint only the current branch’s changes. It is a developer-experience change intended to avoid Docker volume-sync overhead, especially on macOS. No source code, dependencies, or lint rules are modified.
Changed components
MakefileInspect captured patch +14 / −2
diff --git a/Makefile b/Makefile
index 7df5941..aa98b4d 100644
--- a/Makefile
+++ b/Makefile
@@ -369,7 +369,7 @@ check-go-version-dockerfile:
check-go-version: check-go-version-dockerfile check-go-version-yaml
#? lint-source: Run static code analysis
-lint-source: docker-tools
+lint-source: docker-tools
@$(call print, "Linting source.")
$(DOCKER_TOOLS_LINT) custom-gcl run -v $(LINT_WORKERS)
@@ -381,7 +381,18 @@ lint-config-check:
$(GOTOOL) $(GOLINT_PKG) config verify -v
#? lint: Run static code analysis
-lint: check-go-version lint-config-check lint-source
+lint: check-go-version lint-config-check lint-source
+
+#? build-native-linter: Build the custom golangci-lint binary natively
+build-native-linter:
+ @$(call print, "Building custom linter natively.")
+ cd tools && CGO_ENABLED=0 $(GOCC) tool $(GOLINT_PKG) custom
+
+#? lint-native: Run static code analysis without Docker (faster on macOS)
+lint-native: check-go-version lint-config-check build-native-linter
+ @$(call print, "Linting source (native).")
+ GOWORK=off ./tools/custom-gcl run -v $(LINT_WORKERS) \
+ --new-from-rev=$$(git merge-base HEAD master)
#? protolint: Lint proto files using protolint
protolint:
@@ -524,6 +535,7 @@ clean-docker-volumes:
flake-unit \
fmt \
lint \
+ lint-native \
list \
rpc \
rpc-format \
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.