Skip to content

Commit ae858e5

Browse files
authored
chore: Fix yaml formatter so that it only formats the config/ directory (#440)
We need to automatically format the yaml in config/ because some of it is generated by controller-runtime and kubebuilder, some of it is hand-written. The formatter helps us preserve the consistency and minimize noisy diffs when we upgrade the tools that generate yaml. However, we don't want to format the hand-written yaml used elsewhere in this project as tool configuration and example docs. The yaml formatter makes the yaml consistent, but not as readable.
1 parent 43e29d7 commit ae858e5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ go_fmt: # Automatically formats go files
124124
go mod tidy
125125
go run golang.org/x/tools/cmd/goimports@latest -w .
126126

127-
yaml_fmt: # Automatically formats all yaml files
128-
go run github.com/UltiRequiem/yamlfmt@latest -w $(shell find . -iname '*.yaml' -or -iname '*.yml' | grep -v -e '^./bin/' | grep -v -e '^./.github/workflows/')
127+
yaml_fmt: # Automatically format config/ to make generated and handwritten k8s yaml files consistent
128+
go run github.com/UltiRequiem/yamlfmt@latest -w \
129+
$(shell find ./config -iname '*.yaml' -or -iname '*.yml') $(shell find ./installer -iname '*.yaml' -or -iname '*.yml')
129130

130131
.PHONY: add_copyright_header
131132
add_copyright_header: # Add the copyright header

0 commit comments

Comments
 (0)