Skip to content

Commit

Permalink
Makefile+docs: Migrate YAML linting to own makefile target.
Browse files Browse the repository at this point in the history
This commit moves the YAML linting logic in the Makefile to be under the
new `check-yaml-tests` target, so that the `make check` target does not
mix Go and YAML errors together.

Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
  • Loading branch information
philipaconrad committed Jan 7, 2024
1 parent 31b8ddb commit 56ded7f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,6 @@ ifeq ($(DOCKER_RUNNING), 1)
else
@echo "Docker not installed or running. Skipping golangci run."
endif
ifeq ($(DOCKER_RUNNING), 1)
docker run --rm -v $(shell pwd):/data:ro,Z -w /data pipelinecomponents/yamllint:${YAML_LINT_VERSION} yamllint test/cases/testdata
else
@echo "Docker not installed or running. Skipping yamllint run."
endif

.PHONY: fmt
fmt:
Expand Down Expand Up @@ -480,6 +475,14 @@ check-go-module:
$(RELEASE_BUILD_IMAGE) \
/bin/bash -c "git config --system --add safe.directory /src && go mod vendor -v"

.PHONY: check-yaml-tests
check-yaml-tests:
ifeq ($(DOCKER_RUNNING), 1)
docker run --rm -v $(shell pwd):/data:ro,Z -w /data pipelinecomponents/yamllint:${YAML_LINT_VERSION} yamllint test/cases/testdata
else
@echo "Docker not installed or running. Skipping yamllint run."
endif

######################################################
#
# Release targets
Expand Down
2 changes: 2 additions & 0 deletions docs/content/contrib-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ git rebase upstream/main
> style.
> For YAML files, you may need to run the `yamllint` tool on the
> `test/cases/testdata` folder to make sure any new tests are well-formatted.
> If you have Docker available, you can run `make check-yaml-tests` to
> run `yamllint` on the tests without installing any Python dependencies.

### Submission
Expand Down

0 comments on commit 56ded7f

Please sign in to comment.