From 3e8e98e4a727f7d328fbb9ad6727036653fa7c4c Mon Sep 17 00:00:00 2001 From: Ben Nelson Date: Wed, 25 Jul 2018 16:50:03 -0600 Subject: [PATCH] fix blank spaces not being caught in several cython file types includes *.pyx, *.pyi, *.pyi.in, *.pyd refs #21980 --- ci/lint.sh | 32 +++++++++++++++++++++++++++++++- pandas/_libs/tslibs/period.pyx | 2 +- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/ci/lint.sh b/ci/lint.sh index 9bcee55e1344c3..b2f52e1c851e94 100755 --- a/ci/lint.sh +++ b/ci/lint.sh @@ -49,6 +49,13 @@ if [ "$LINT" ]; then if [ $? -ne "0" ]; then RET=1 fi + + trailing_space_pyx=$(find **/*\.pyx -type f -exec egrep -l " +$" {} \;) + if [[ -n $trailing_space_pyx ]] + then + RET=1 + echo $trailing_space_pyx + fi echo "Linting *.pyx DONE" echo "Linting *.pxi.in" @@ -60,6 +67,21 @@ if [ "$LINT" ]; then RET=1 fi done + + trailing_space_pxi_in=$(find **/*\.pxi\.in -type f -exec egrep -l " +$" {} \;) + if [[ -n $trailing_space_pxi_in ]] + then + RET=1 + echo $trailing_space_pxi_in + fi + + trailing_space_pxi=$(find **/*\.pxi -type f -exec egrep -l " +$" {} \;) + if [[ -n $trailing_space_pxi ]] + then + RET=1 + echo $trailing_space_pxi + fi + echo "Linting *.pxi.in DONE" echo "Linting *.pxd" @@ -71,6 +93,14 @@ if [ "$LINT" ]; then RET=1 fi done + + trailing_space_pyd=$(find **/*\.pyd -type f -exec egrep -l " +$" {} \;) + if [[ -n $trailing_space_pyd ]] + then + RET=1 + echo $trailing_space_pyd + fi + echo "Linting *.pxd DONE" # readability/casting: Warnings about C casting instead of C++ casting @@ -173,7 +203,7 @@ if [ "$LINT" ]; then RET=1 fi echo "Check for old-style classes DONE" - + echo "Check for backticks incorrectly rendering because of missing spaces" grep -R --include="*.rst" -E "[a-zA-Z0-9]\`\`?[a-zA-Z0-9]" doc/source/ diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index cd3ce5c1a8f091..9e3d6c3975c421 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -1538,7 +1538,7 @@ cdef class _Period(object): See Also -------- Period.year : Return the calendar year of the period. - + Examples -------- If the natural and fiscal year are the same, `qyear` and `year` will