From 2d12bb57506d72a110eaedcf65783fd49a045854 Mon Sep 17 00:00:00 2001 From: Lucy Liu Date: Tue, 19 May 2020 15:50:19 +0200 Subject: [PATCH] CI Check default doctest directives in linter (#17269) * add grep * directs to test CI * attempt2 * better output format * use find * revert test rst file * better message * faster grep --- build_tools/circle/linting.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build_tools/circle/linting.sh b/build_tools/circle/linting.sh index dad7ad95ce7c1..c23cd80d3afd6 100755 --- a/build_tools/circle/linting.sh +++ b/build_tools/circle/linting.sh @@ -161,3 +161,14 @@ then echo $bad_deprecation_property_order exit 1 fi + +# Check for default doctest directives ELLIPSIS and NORMALIZE_WHITESPACE + +doctest_directive="$(git grep -nw -E "# doctest\: \+(ELLIPSIS|NORMALIZE_WHITESPACE)")" + +if [ ! -z "$doctest_directive" ] +then + echo "ELLIPSIS and NORMALIZE_WHITESPACE doctest directives are enabled by default, but were found in:" + echo "$doctest_directive" + exit 1 +fi