-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lint rule to catch incorrect sphinx directives #18437
Conversation
@@ -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 .*\]\)" * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a *
in the end because without it this regexp will just wait for stdin (unless linux version works differently. I tried it on mac).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. On Linux, it will grep all directories without the *
, but for consistency adding *
or .
is good.
c08c962
to
1f5508c
Compare
1f5508c
to
87aae09
Compare
Codecov Report
@@ Coverage Diff @@
## master #18437 +/- ##
==========================================
- Coverage 91.35% 91.34% -0.02%
==========================================
Files 163 163
Lines 49691 49691
==========================================
- Hits 45397 45388 -9
- Misses 4294 4303 +9
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small comment. ping when pushed / green.
ci/lint.sh
Outdated
"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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could include *.pyx here as well (I don't know if we actually have doc-strings that include directives in cython, but can't hurt).
thanks @Scorpil nice patch! |
git diff upstream/master -u -- "*.py" | flake8 --diff