From cd0281e766e9d0ebf85022d47c5403dc6da5f66e Mon Sep 17 00:00:00 2001 From: Michal Wasilewski Date: Sun, 9 May 2021 21:00:13 +0200 Subject: [PATCH] Adds yamllinting to Makefile.common * adds yamllint target to Makefile.common for use by all Prometheus projects Signed-off-by: Michal Wasilewski --- .yamllint | 16 ++++++++++++++++ Makefile.common | 7 ++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .yamllint diff --git a/.yamllint b/.yamllint new file mode 100644 index 000000000..15b61d47b --- /dev/null +++ b/.yamllint @@ -0,0 +1,16 @@ +--- +extends: default + +rules: + braces: + max-spaces-inside: 1 + level: error + brackets: + max-spaces-inside: 1 + level: error + commas: disable + comments: disable + comments-indentation: disable + indentation: + spaces: consistent + line-length: disable diff --git a/Makefile.common b/Makefile.common index ce80d530a..bbdec8ef5 100644 --- a/Makefile.common +++ b/Makefile.common @@ -118,7 +118,7 @@ endif %: common-% ; .PHONY: common-all -common-all: precheck style check_license lint unused build test +common-all: precheck style check_license lint yamllint unused build test .PHONY: common-style common-style: @@ -198,6 +198,11 @@ else endif endif +.PHONY: common-yamllint +common-yamllint: + @echo ">> running yamllint on all YAML files in the repository" + yamllint . + # For backward-compatibility. .PHONY: common-staticcheck common-staticcheck: lint