Skip to content

Commit e563349

Browse files
committed
Group per file definitions together
Its easier to reason about things if they are all close to each other. Now that lint and fix are at the bottom of the file there is no need to split up definitions. Signed-off-by: Manuel Mendez <[email protected]>
1 parent ab0064c commit e563349

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
.PHONY: lint
66
lint: _lint
77

8-
GOLINT_VERSION ?= v1.42.1
9-
HADOLINT_VERSION ?= v2.7.0
10-
SHELLCHECK_VERSION ?= v0.7.2
11-
YAMLLINT_VERSION ?= 1.26.3
128
LINT_ARCH := $(shell uname -m)
139
LINT_OS := $(shell uname)
1410
LINT_OS_LOWER := $(shell echo $(LINT_OS) | tr '[:upper:]' '[:lower:]')
@@ -21,27 +17,31 @@ ifeq ($(LINT_OS),Darwin)
2117
endif
2218
endif
2319

24-
GOLINT_CONFIG = $(LINT_ROOT)/.golangci.yml
25-
YAMLLINT_ROOT = out/linters/yamllint-$(YAMLLINT_VERSION)
2620

21+
SHELLCHECK_VERSION ?= v0.7.2
2722
out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)/shellcheck:
2823
mkdir -p out/linters
2924
rm -rf out/linters/shellcheck-*
3025
curl -sSfL https://github.com/koalaman/shellcheck/releases/download/$(SHELLCHECK_VERSION)/shellcheck-$(SHELLCHECK_VERSION).$(LINT_OS_LOWER).$(LINT_ARCH).tar.xz | tar -C out/linters -xJf -
3126
mv out/linters/shellcheck-$(SHELLCHECK_VERSION) out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)
3227

28+
HADOLINT_VERSION ?= v2.7.0
3329
out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH):
3430
mkdir -p out/linters
3531
rm -rf out/linters/hadolint-*
3632
curl -sfL https://github.com/hadolint/hadolint/releases/download/v2.6.1/hadolint-$(LINT_OS)-$(LINT_ARCH) > out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH)
3733
chmod u+x out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH)
3834

35+
GOLINT_CONFIG = $(LINT_ROOT)/.golangci.yml
36+
GOLINT_VERSION ?= v1.42.1
3937
out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH):
4038
mkdir -p out/linters
4139
rm -rf out/linters/golangci-lint-*
4240
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b out/linters $(GOLINT_VERSION)
4341
mv out/linters/golangci-lint out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH)
4442

43+
YAMLLINT_VERSION ?= 1.26.3
44+
YAMLLINT_ROOT = out/linters/yamllint-$(YAMLLINT_VERSION)
4545
$(YAMLLINT_ROOT)/dist/bin/yamllint:
4646
mkdir -p out/linters
4747
rm -rf out/linters/yamllint-*

Makefile.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
.PHONY: lint
66
lint: _lint
77

8-
{{ if .Go }}GOLINT_VERSION ?= v1.42.1{{ end }}
9-
{{ if .Dockerfile}}HADOLINT_VERSION ?= v2.7.0{{ end }}
10-
{{ if .Shell}}SHELLCHECK_VERSION ?= v0.7.2{{ end }}
11-
{{ if .YAML}}YAMLLINT_VERSION ?= 1.26.3{{ end }}
128
LINT_ARCH := $(shell uname -m)
139
LINT_OS := $(shell uname)
1410
LINT_OS_LOWER := $(shell echo $(LINT_OS) | tr '[:upper:]' '[:lower:]')
@@ -21,10 +17,9 @@ ifeq ($(LINT_OS),Darwin)
2117
endif
2218
endif
2319

24-
{{ if .Go }}GOLINT_CONFIG = $(LINT_ROOT)/.golangci.yml{{ end }}
25-
{{ if .YAML }}YAMLLINT_ROOT = out/linters/yamllint-$(YAMLLINT_VERSION){{ end }}
2620

2721
{{ if .Shell -}}
22+
SHELLCHECK_VERSION ?= v0.7.2
2823
out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)/shellcheck:
2924
mkdir -p out/linters
3025
rm -rf out/linters/shellcheck-*
@@ -33,6 +28,7 @@ out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)/shellcheck:
3328

3429
{{ end -}}
3530
{{ if .Dockerfile -}}
31+
HADOLINT_VERSION ?= v2.7.0
3632
out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH):
3733
mkdir -p out/linters
3834
rm -rf out/linters/hadolint-*
@@ -41,6 +37,8 @@ out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH):
4137

4238
{{ end -}}
4339
{{ if .Go -}}
40+
GOLINT_CONFIG = $(LINT_ROOT)/.golangci.yml
41+
GOLINT_VERSION ?= v1.42.1
4442
out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH):
4543
mkdir -p out/linters
4644
rm -rf out/linters/golangci-lint-*
@@ -50,6 +48,8 @@ out/linters/golangci-lint-$(GOLINT_VERSION)-$(LINT_ARCH):
5048
{{ end -}}
5149

5250
{{ if .YAML -}}
51+
YAMLLINT_VERSION ?= 1.26.3
52+
YAMLLINT_ROOT = out/linters/yamllint-$(YAMLLINT_VERSION)
5353
$(YAMLLINT_ROOT)/dist/bin/yamllint:
5454
mkdir -p out/linters
5555
rm -rf out/linters/yamllint-*

0 commit comments

Comments
 (0)