diff --git a/Makefile b/Makefile index 338abd5915b4..56e2f90e2a14 100644 --- a/Makefile +++ b/Makefile @@ -56,6 +56,10 @@ test-compile: check-links test-compile-changed: os-autoinst/ export PERL5LIB=${PERL5LIB_} ; for f in `git diff --name-only | grep '.pm'` ; do perl -c $$f 2>&1 | grep -v " OK$$" && exit 2; done ; true +.PHONY: test_pod_whitespace_rule +test_pod_whitespace_rule: + tools/check_pod_whitespace_rule + .PHONY: test-yaml-valid test-yaml-valid: $(eval YAMLS=$(shell sh -c "git ls-files schedule/ test_data/ | grep '\\.ya\?ml$$'")) @@ -107,7 +111,7 @@ test-spec: tools/update_spec --check .PHONY: test-static -test-static: tidy-check test-yaml-valid test-modules-in-yaml-schedule test-merge test-dry test-no-wait_idle test-deleted-renamed-referenced-files test-unused-modules-changed test-soft_failure-no-reference test-spec test-invalid-syntax test-code-style test-metadata +test-static: tidy-check test-yaml-valid test-modules-in-yaml-schedule test-merge test-dry test-no-wait_idle test-deleted-renamed-referenced-files test-unused-modules-changed test-soft_failure-no-reference test-spec test-invalid-syntax test-code-style test-metadata test_pod_whitespace_rule .PHONY: test ifeq ($(TESTS),compile) diff --git a/tools/check_pod_whitespace_rule b/tools/check_pod_whitespace_rule new file mode 100755 index 000000000000..03da32e0cfdf --- /dev/null +++ b/tools/check_pod_whitespace_rule @@ -0,0 +1,10 @@ +#!/bin/bash -ex +<< 'heredoc_pod_whitespace_rule' +As a convention the POD and the code needs to have an empty line in between. +The script checks all the files rather the commit files in the lib directory. +heredoc_pod_whitespace_rule + + +grep -Pzo "=cut\nsub" -rn lib || exit 0 +echo -e '\033[0;31mCheck for whitespace after end of POD failed.\nAdd a empty line between =cut and code.' +exit 1