@@ -69,7 +69,7 @@ shellcheck-fix: $(SHELLCHECK_BIN)
6969 $(SHELLCHECK_BIN ) $(shell find . -name "* .sh") -f diff | { read -t 1 line || exit 0; { echo " $$ line" && cat; } | git apply -p2; }
7070
7171GOLANGCI_LINT_CONFIG := $(LINT_ROOT ) /.golangci.yml
72- GOLANGCI_LINT_VERSION ?= v2.3.1
72+ GOLANGCI_LINT_VERSION ?= v2.5.0
7373GOLANGCI_LINT_BIN := $(LINT_ROOT ) /out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION ) -$(LINT_ARCH )
7474$(GOLANGCI_LINT_BIN ) :
7575 mkdir -p $(LINT_ROOT ) /out/linters
@@ -85,10 +85,59 @@ FIXERS += golangci-lint-fix
8585golangci-lint-fix : $(GOLANGCI_LINT_BIN )
8686 find . -name go.mod -execdir " $( GOLANGCI_LINT_BIN) " run -c " $( GOLANGCI_LINT_CONFIG) " --fix \;
8787
88+ YAMLLINT_VERSION ?= 1.37.1
89+ YAMLLINT_ROOT := $(LINT_ROOT ) /out/linters/yamllint-$(YAMLLINT_VERSION )
90+ YAMLLINT_BIN := $(YAMLLINT_ROOT ) /dist/bin/yamllint
91+ $(YAMLLINT_BIN ) :
92+ mkdir -p $(LINT_ROOT ) /out/linters
93+ rm -rf $(LINT_ROOT ) /out/linters/yamllint-*
94+ curl -sSfL https://github.com/adrienverge/yamllint/archive/refs/tags/v$(YAMLLINT_VERSION ) .tar.gz | tar -C $(LINT_ROOT ) /out/linters -zxf -
95+ cd $(YAMLLINT_ROOT ) && pip3 install --target dist . || pip install --target dist .
96+
97+ LINTERS += yamllint-lint
98+ yamllint-lint : $(YAMLLINT_BIN )
99+ PYTHONPATH=$(YAMLLINT_ROOT ) /dist $(YAMLLINT_ROOT ) /dist/bin/yamllint .
100+
101+ BIOME_VERSION ?= 2.2.6
102+ BIOME_BIN := $(LINT_ROOT ) /out/linters/biome-$(BIOME_VERSION ) -$(LINT_ARCH )
103+ BIOME_CONFIG := $(LINT_ROOT ) /biome.json
104+
105+ # Map architecture names for Biome downloads
106+ BIOME_ARCH := $(LINT_ARCH )
107+ ifeq ($(LINT_ARCH ) ,x86_64)
108+ BIOME_ARCH := x64
109+ endif
110+
111+ $(BIOME_BIN ) :
112+ mkdir -p $(LINT_ROOT ) /out/linters
113+ rm -rf $(LINT_ROOT ) /out/linters/biome-*
114+ curl -sSfL -o $@ https://github.com/biomejs/biome/releases/download/%40biomejs%2Fbiome%40$(BIOME_VERSION ) /biome-$(LINT_OS_LOWER ) -$(BIOME_ARCH ) \
115+ || echo " Unable to fetch biome for $( LINT_OS_LOWER) /$( BIOME_ARCH) , falling back to local install"
116+ test -f $@ || printf " #!/usr/bin/env biome\n" > $@
117+ chmod u+x $@
118+
119+ LINTERS += biome-lint
120+ biome-lint : $(BIOME_BIN )
121+ $(BIOME_BIN ) check --config-path=$(BIOME_CONFIG ) .
122+
123+ FIXERS += biome-fix
124+ biome-fix : $(BIOME_BIN )
125+ $(BIOME_BIN ) check --write --config-path=$(BIOME_CONFIG ) .
126+
88127.PHONY : _lint $(LINTERS )
89- _lint : $(LINTERS )
128+ _lint :
129+ @exit_code=0; \
130+ for target in $( LINTERS) ; do \
131+ $(MAKE ) $$ target || exit_code=1; \
132+ done ; \
133+ exit $$ exit_code
90134
91135.PHONY : fix $(FIXERS )
92- fix : $(FIXERS )
136+ fix :
137+ @exit_code=0; \
138+ for target in $( FIXERS) ; do \
139+ $(MAKE ) $$ target || exit_code=1; \
140+ done ; \
141+ exit $$ exit_code
93142
94143# END: lint-install .
0 commit comments