Skip to content

Commit e037677

Browse files
committed
BLD: Check for incorrect sphinx directives in lint
1 parent fedc503 commit e037677

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

ci/lint.sh

+15-2
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,26 @@ if [ "$LINT" ]; then
9090
#
9191
# Check the following functions:
9292
# any(), all(), sum(), max(), min(), list(), dict(), set(), frozenset(), tuple(), str.join()
93-
grep -R --include="*.py*" -E "[^_](any|all|sum|max|min|list|dict|set|frozenset|tuple|join)\(\[.* for .* in .*\]\)"
93+
grep -R --include="*.py*" -E "[^_](any|all|sum|max|min|list|dict|set|frozenset|tuple|join)\(\[.* for .* in .*\]\)" *
9494

95-
if [ $? = "0" ]; then
95+
if [ $? -ne "0" ]; then
9696
RET=1
9797
fi
9898
echo "Check for use of lists instead of generators in built-in Python functions DONE"
9999

100+
echo "Check for incorrect sphinx directives"
101+
SPHINX_DIRECTIVES=$(echo \
102+
"autosummary|contents|currentmodule|deprecated|function|image|"\
103+
"important|include|ipython|literalinclude|math|module|note|raw|"\
104+
"seealso|toctree|versionadded|versionchanged|warning" | tr -d "[:space:]")
105+
for path in './pandas' './doc/source'
106+
do
107+
grep -R --include="*.py" --include="*.rst" -E "\.\. ($SPHINX_DIRECTIVES):[^:]" $path
108+
if [ $? -ne "0" ]; then
109+
RET=1
110+
fi
111+
done
112+
echo "Check for incorrect sphinx directives DONE"
100113
else
101114
echo "NOT Linting"
102115
fi

0 commit comments

Comments
 (0)