Skip to content
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

Merged
merged 3 commits into from
Nov 24, 2017

Conversation

Scorpil
Copy link
Contributor

@Scorpil Scorpil commented Nov 22, 2017

@@ -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 .*\]\)" *
Copy link
Contributor Author

@Scorpil Scorpil Nov 22, 2017

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).

Copy link
Member

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.

@Scorpil Scorpil force-pushed the lint_sphinx_directives branch from c08c962 to 1f5508c Compare November 22, 2017 23:47
@Scorpil Scorpil force-pushed the lint_sphinx_directives branch from 1f5508c to 87aae09 Compare November 22, 2017 23:56
@codecov
Copy link

codecov bot commented Nov 23, 2017

Codecov Report

Merging #18437 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Flag Coverage Δ
#multiple 89.14% <ø> (ø) ⬆️
#single 39.67% <ø> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/tools/datetimes.py 84.48% <ø> (ø) ⬆️
pandas/core/frame.py 97.8% <ø> (-0.1%) ⬇️
pandas/tseries/offsets.py 97% <ø> (ø) ⬆️
pandas/core/series.py 94.84% <ø> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fedc503...aa936b8. Read the comment docs.

@jreback jreback added CI Continuous Integration Docs labels Nov 23, 2017
Copy link
Contributor

@jreback jreback left a 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
Copy link
Contributor

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).

@jreback jreback added this to the 0.22.0 milestone Nov 23, 2017
@jreback jreback merged commit de5faf1 into pandas-dev:master Nov 24, 2017
@jreback
Copy link
Contributor

jreback commented Nov 24, 2017

thanks @Scorpil nice patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lint rule to catch incorrect sphinx directives
3 participants