Skip to content

Commit

Permalink
BLD: Check for incorrect sphinx directives in lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Scorpil committed Nov 22, 2017
1 parent fedc503 commit e037677
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions ci/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,26 @@ if [ "$LINT" ]; then
#
# Check the following functions:
# any(), all(), sum(), max(), min(), list(), dict(), set(), frozenset(), tuple(), str.join()
grep -R --include="*.py*" -E "[^_](any|all|sum|max|min|list|dict|set|frozenset|tuple|join)\(\[.* for .* in .*\]\)"
grep -R --include="*.py*" -E "[^_](any|all|sum|max|min|list|dict|set|frozenset|tuple|join)\(\[.* for .* in .*\]\)" *

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

echo "Check for incorrect sphinx directives"
SPHINX_DIRECTIVES=$(echo \
"autosummary|contents|currentmodule|deprecated|function|image|"\
"important|include|ipython|literalinclude|math|module|note|raw|"\
"seealso|toctree|versionadded|versionchanged|warning" | tr -d "[:space:]")
for path in './pandas' './doc/source'
do
grep -R --include="*.py" --include="*.rst" -E "\.\. ($SPHINX_DIRECTIVES):[^:]" $path
if [ $? -ne "0" ]; then
RET=1
fi
done
echo "Check for incorrect sphinx directives DONE"
else
echo "NOT Linting"
fi
Expand Down

0 comments on commit e037677

Please sign in to comment.