Skip to content

Commit 3e8e98e

Browse files
fix blank spaces not being caught in several cython file types
includes *.pyx, *.pyi, *.pyi.in, *.pyd refs #21980
1 parent 761dc98 commit 3e8e98e

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

ci/lint.sh

+31-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ if [ "$LINT" ]; then
4949
if [ $? -ne "0" ]; then
5050
RET=1
5151
fi
52+
53+
trailing_space_pyx=$(find **/*\.pyx -type f -exec egrep -l " +$" {} \;)
54+
if [[ -n $trailing_space_pyx ]]
55+
then
56+
RET=1
57+
echo $trailing_space_pyx
58+
fi
5259
echo "Linting *.pyx DONE"
5360

5461
echo "Linting *.pxi.in"
@@ -60,6 +67,21 @@ if [ "$LINT" ]; then
6067
RET=1
6168
fi
6269
done
70+
71+
trailing_space_pxi_in=$(find **/*\.pxi\.in -type f -exec egrep -l " +$" {} \;)
72+
if [[ -n $trailing_space_pxi_in ]]
73+
then
74+
RET=1
75+
echo $trailing_space_pxi_in
76+
fi
77+
78+
trailing_space_pxi=$(find **/*\.pxi -type f -exec egrep -l " +$" {} \;)
79+
if [[ -n $trailing_space_pxi ]]
80+
then
81+
RET=1
82+
echo $trailing_space_pxi
83+
fi
84+
6385
echo "Linting *.pxi.in DONE"
6486

6587
echo "Linting *.pxd"
@@ -71,6 +93,14 @@ if [ "$LINT" ]; then
7193
RET=1
7294
fi
7395
done
96+
97+
trailing_space_pyd=$(find **/*\.pyd -type f -exec egrep -l " +$" {} \;)
98+
if [[ -n $trailing_space_pyd ]]
99+
then
100+
RET=1
101+
echo $trailing_space_pyd
102+
fi
103+
74104
echo "Linting *.pxd DONE"
75105

76106
# readability/casting: Warnings about C casting instead of C++ casting
@@ -173,7 +203,7 @@ if [ "$LINT" ]; then
173203
RET=1
174204
fi
175205
echo "Check for old-style classes DONE"
176-
206+
177207
echo "Check for backticks incorrectly rendering because of missing spaces"
178208
grep -R --include="*.rst" -E "[a-zA-Z0-9]\`\`?[a-zA-Z0-9]" doc/source/
179209

pandas/_libs/tslibs/period.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ cdef class _Period(object):
15381538
See Also
15391539
--------
15401540
Period.year : Return the calendar year of the period.
1541-
1541+
15421542
Examples
15431543
--------
15441544
If the natural and fiscal year are the same, `qyear` and `year` will

0 commit comments

Comments
 (0)