Skip to content

Commit b48895c

Browse files
committed
Rename GOLINT_ to GOLANGCI_LINT_ to match other variables
All the other variable names are suffixes to the cli tool's name, this was the only odd ball. Lets be consistent! Signed-off-by: Manuel Mendez <[email protected]>
1 parent e563349 commit b48895c

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH):
3232
curl -sfL https://github.com/hadolint/hadolint/releases/download/v2.6.1/hadolint-$(LINT_OS)-$(LINT_ARCH) > out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH)
3333
chmod u+x out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH)
3434

35-
GOLINT_CONFIG = $(LINT_ROOT)/.golangci.yml
36-
GOLINT_VERSION ?= v1.42.1
37-
out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH):
35+
GOLANGCI_LINT_CONFIG = $(LINT_ROOT)/.golangci.yml
36+
GOLANGCI_LINT_VERSION ?= v1.42.1
37+
out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH):
3838
mkdir -p out/linters
3939
rm -rf out/linters/golangci-lint-*
40-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b out/linters $(GOLINT_VERSION)
41-
mv out/linters/golangci-lint out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH)
40+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b out/linters $(GOLANGCI_LINT_VERSION)
41+
mv out/linters/golangci-lint out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH)
4242

4343
YAMLLINT_VERSION ?= 1.26.3
4444
YAMLLINT_ROOT = out/linters/yamllint-$(YAMLLINT_VERSION)
@@ -48,15 +48,15 @@ $(YAMLLINT_ROOT)/dist/bin/yamllint:
4848
curl -sSfL https://github.com/adrienverge/yamllint/archive/refs/tags/v$(YAMLLINT_VERSION).tar.gz | tar -C out/linters -zxf -
4949
cd $(YAMLLINT_ROOT) && pip3 install . -t dist
5050
.PHONY: _lint
51-
_lint: out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)/shellcheck out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH) out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH) $(YAMLLINT_ROOT)/dist/bin/yamllint
52-
out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH) run
51+
_lint: out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)/shellcheck out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH) out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH) $(YAMLLINT_ROOT)/dist/bin/yamllint
52+
out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH) run
5353
out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH) $(shell find . -name "*Dockerfile")
5454
out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)/shellcheck $(shell find . -name "*.sh")
5555
PYTHONPATH=$(YAMLLINT_ROOT)/dist $(YAMLLINT_ROOT)/dist/bin/yamllint .
5656

5757
.PHONY: fix
58-
fix: out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)/shellcheck out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH)
59-
out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH) run --fix
58+
fix: out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)/shellcheck out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH)
59+
out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH) run --fix
6060
out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)/shellcheck $(shell find . -name "*.sh") -f diff | { read -t 1 line || exit 0; { echo "$$line" && cat; } | git apply -p2; }
6161

6262
# END: lint-install .

Makefile.tmpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH):
3737

3838
{{ end -}}
3939
{{ if .Go -}}
40-
GOLINT_CONFIG = $(LINT_ROOT)/.golangci.yml
41-
GOLINT_VERSION ?= v1.42.1
42-
out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH):
40+
GOLANGCI_LINT_CONFIG = $(LINT_ROOT)/.golangci.yml
41+
GOLANGCI_LINT_VERSION ?= v1.42.1
42+
out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH):
4343
mkdir -p out/linters
4444
rm -rf out/linters/golangci-lint-*
45-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b out/linters $(GOLINT_VERSION)
46-
mv out/linters/golangci-lint out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH)
45+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b out/linters $(GOLANGCI_LINT_VERSION)
46+
mv out/linters/golangci-lint out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH)
4747

4848
{{ end -}}
4949

@@ -58,12 +58,12 @@ $(YAMLLINT_ROOT)/dist/bin/yamllint:
5858
{{ end -}}
5959

6060
.PHONY: _lint
61-
_lint: {{ if .Shell }}out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)/shellcheck {{ end }}{{ if .Dockerfile }}out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH) {{ end }}{{ if .Go}}out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH) {{ end }}{{ if .YAML}}$(YAMLLINT_ROOT)/dist/bin/yamllint{{ end }}
61+
_lint: {{ if .Shell }}out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)/shellcheck {{ end }}{{ if .Dockerfile }}out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH) {{ end }}{{ if .Go}}out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH) {{ end }}{{ if .YAML}}$(YAMLLINT_ROOT)/dist/bin/yamllint{{ end }}
6262
{{- range .LintCommands }}
6363
{{ .}}{{ end}}
6464

6565
.PHONY: fix
66-
fix: {{ if .Shell }}out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)/shellcheck {{ end }}{{ if .Go}}out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH){{ end }}
66+
fix: {{ if .Shell }}out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)/shellcheck {{ end }}{{ if .Go}}out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH){{ end }}
6767
{{- range .FixCommands }}
6868
{{ .}}{{ end}}
6969

lint-install.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ func goLintCmd(root string, level string, fix bool) string {
255255

256256
klog.Infof("found %d modules within %s: %s", len(found), root, found)
257257
if len(found) == 0 || (len(found) == 1 && found[0] == strings.Trim(root, "/")) {
258-
return fmt.Sprintf("out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH) run%s", suffix)
258+
return fmt.Sprintf("out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH) run%s", suffix)
259259
}
260260

261-
return fmt.Sprintf(`find . -name go.mod -execdir "$(LINT_ROOT)/out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH)" run -c "$(GOLINT_CONFIG)"%s \;`, suffix)
261+
return fmt.Sprintf(`find . -name go.mod -execdir "$(LINT_ROOT)/out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH)" run -c "$(GOLINT_CONFIG)"%s \;`, suffix)
262262
}
263263

264264
// shellLintCmd returns the appropriate shell lint command for a project.

0 commit comments

Comments
 (0)