Skip to content

Commit

Permalink
Lint YAML files in the CI (#45)
Browse files Browse the repository at this point in the history
* Lint YAML files in the CI

* Break YAML file on purpose to test CI

* Restore YAML file
  • Loading branch information
joaopalet authored Feb 1, 2024
1 parent 6ef2be9 commit edb6873
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Empty rules means that only syntax is checked
rules: {}
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ lint-golangci-lint:
@echo "Linting with golangci-lint"
@golangci-lint run ${GOLANG_CI_ARGS}

lint: lint-golangci-lint
lint-yamllint:
@echo "Linting with yamllint"
@yamllint -c .yamllint.yaml .

lint: lint-golangci-lint lint-yamllint

# Test
test:
Expand Down
9 changes: 9 additions & 0 deletions scripts/project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,17 @@ if [ "$action" = "help" ]; then
[ -f "$0".man ] && man "$0".man || echo "No help, please read the script in ${script}, we will add help later"
elif [ "$action" = "tools" ]; then
cd ${ROOT_DIR}

go mod download
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2

PIP_COMMAND="pip"
if ! command -v yamllint &>/dev/null; then
if command -v pip3 &>/dev/null; then
PIP_COMMAND="pip3"
fi
$PIP_COMMAND install yamllint
fi
else
echo "Invalid action: '$action', please use $0 help for help"
fi

0 comments on commit edb6873

Please sign in to comment.