From a1bf64e3ad18d3d480f898bbe46fc8575527ac8e Mon Sep 17 00:00:00 2001 From: Ayowolet Date: Wed, 18 Sep 2019 02:13:23 +0100 Subject: [PATCH 1/2] CI: Check for whitespaces before class --- ci/code_checks.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 07c99b39e83e8..1f7d79d83a7cc 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -190,6 +190,11 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then invgrep -R --include="*.rst" ".. ipython ::" doc/source RET=$(($RET + $?)) ; echo $MSG "DONE" + # Check for blank lines after the class definition +    MSG='Check for extra blank lines after the class definition' ; echo $MSG +    invgrep -R --include="*.py" --include="*.pyx" -E 'class.*:\n\n( )+"""' doc/source/ +    RET=$(($RET + $?)) ; echo $MSG "DONE" + MSG='Check that no file in the repo contains trailing whitespaces' ; echo $MSG set -o pipefail if [[ "$AZURE" == "true" ]]; then From 5069cdc7c235edfe9cc03ca9a7912cb8283fc4ba Mon Sep 17 00:00:00 2001 From: Ayowolet Date: Fri, 20 Sep 2019 01:21:41 +0100 Subject: [PATCH 2/2] CI: Checking that the modification works on a class --- ci/code_checks.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 1f7d79d83a7cc..ab7bd7895a596 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -190,9 +190,8 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then invgrep -R --include="*.rst" ".. ipython ::" doc/source RET=$(($RET + $?)) ; echo $MSG "DONE" - # Check for blank lines after the class definition     MSG='Check for extra blank lines after the class definition' ; echo $MSG -    invgrep -R --include="*.py" --include="*.pyx" -E 'class.*:\n\n( )+"""' doc/source/ +    invgrep -R --include="*.py" --include="*.pyx" -E 'class.*:\n\n( )+"""' .     RET=$(($RET + $?)) ; echo $MSG "DONE" MSG='Check that no file in the repo contains trailing whitespaces' ; echo $MSG