diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 00000000..b7c869dc --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,2 @@ +# Empty rules means that only syntax is checked +rules: {} \ No newline at end of file diff --git a/Makefile b/Makefile index bee32114..ab57bb90 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/scripts/project.sh b/scripts/project.sh index fd15c32e..4e36e4aa 100755 --- a/scripts/project.sh +++ b/scripts/project.sh @@ -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