Skip to content

Commit 1c6dd14

Browse files
wikkykclaude
andcommitted
ci(lint): replace yamllint action with make target, add kyaml mode
Drop the ibiqlik/action-yamllint GitHub Action in favour of a plain `make yamllint` invocation. The new target runs yamllint (with -f github for CI annotations) followed by yamlfmt -lint -quiet. Switch yamlfmt to kyaml mode for Kubernetes-native YAML canonicalization. Align exclude lists between .yamllint and .yamlfmt configs, tighten yamllint coverage by removing config/default and config/manager from the ignore list. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3ec4f33 commit 1c6dd14

4 files changed

Lines changed: 18 additions & 22 deletions

File tree

.github/workflows/lint.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ jobs:
3838
run: |
3939
sudo apt-get update
4040
sudo apt-get install -y yamllint
41-
- uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1
42-
with:
43-
format: github
41+
- run: make yamllint
4442

4543
actionlint:
4644
name: actionlint

.yamlfmt

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
include:
2-
- metadata.yaml
3-
- .github
4-
- config/default
5-
- config/manager
6-
- config/samples
7-
- config/webhook
8-
- examples
91
exclude:
10-
- .github/workflows
2+
# generated files
3+
- config/crd
4+
- config/certmanager
5+
- config/prometheus
6+
- config/rbac
7+
- out
118
formatter:
129
include_document_start: true
1310
indent: 2
1411
indentless_arrays: true
1512
max_line_length: 120
1613
retain_line_breaks: true
17-
type: basic
14+
type: kyaml

.yamllint

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,10 @@ ignore:
2727
- config/certmanager
2828
- config/prometheus
2929
- config/rbac
30-
- config/manager
31-
- config/default
32-
- test/e2e
3330
- out
34-
- .*.yaml
35-
- .*.yml
36-
# these are clusterctl templates, not yaml
31+
# clusterctl templates use envsubst syntax that isn't valid yaml
32+
# TODO: find a way to lint these (preprocess with envsubst + dummy values?)
3733
- templates
38-
# github actions checked by actionlint
34+
- test/e2e
35+
# github actions have no document-start markers
3936
- .github/workflows

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,12 @@ mockgen: ## Generate mocks.
8282

8383
.PHONY: yamlfmt
8484
yamlfmt: ## Run yamlfmt against yaml.
85-
go tool yamlfmt -dry -quiet
86-
go tool yamlfmt
85+
go tool yamlfmt -verbose
86+
87+
.PHONY: yamllint
88+
yamllint: ## Lint YAML files with yamllint and yamlfmt.
89+
yamllint $(if $(GITHUB_ACTIONS),-f github) .
90+
go tool yamlfmt -lint -quiet
8791

8892
.PHONY: tidy
8993
tidy: ## Run go mod tidy to ensure modules are up to date

0 commit comments

Comments
 (0)