Skip to content

Commit

Permalink
fix blank spaces not being caught in several cython file types
Browse files Browse the repository at this point in the history
includes *.pyx, *.pyi, *.pyi.in, *.pyd

refs pandas-dev#21980
  • Loading branch information
illegalnumbers committed Jul 26, 2018
1 parent 74dc8ba commit 0208713
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
32 changes: 31 additions & 1 deletion ci/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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/

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/period.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0208713

Please sign in to comment.