Skip to content

Commit

Permalink
CI move check incorrect sphinx directives to pre-commit (pandas-dev#3…
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli authored and JulianWgs committed Oct 26, 2020
1 parent 6d29f54 commit dd7d290
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 10 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ repos:
types: [rst]
args: [--filename=*.rst]
additional_dependencies: [flake8-rst==0.7.0, flake8==3.7.9]
- id: incorrect-sphinx-directives
name: Check for incorrect Sphinx directives
language: pygrep
entry: >-
\.\. (autosummary|contents|currentmodule|deprecated
|function|image|important|include|ipython|literalinclude
|math|module|note|raw|seealso|toctree|versionadded
|versionchanged|warning):[^:]
files: \.(py|pyx|rst)$
- repo: https://github.com/asottile/yesqa
rev: v1.2.2
hooks:
Expand All @@ -61,4 +70,4 @@ repos:
rev: v3.2.0
hooks:
- id: end-of-file-fixer
exclude: '.html$|^LICENSES/|.csv$|.txt$|.svg$|.py$'
exclude: ^LICENSES/|\.(html|csv|txt|svg|py)$
4 changes: 0 additions & 4 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
invgrep -R --include="*.rst" -E "[a-zA-Z0-9]\`\`?[a-zA-Z0-9]" doc/source/
RET=$(($RET + $?)) ; echo $MSG "DONE"

MSG='Check for incorrect sphinx directives' ; echo $MSG
invgrep -R --include="*.py" --include="*.pyx" --include="*.rst" -E "\.\. (autosummary|contents|currentmodule|deprecated|function|image|important|include|ipython|literalinclude|math|module|note|raw|seealso|toctree|versionadded|versionchanged|warning):[^:]" ./pandas ./doc/source
RET=$(($RET + $?)) ; echo $MSG "DONE"

# Check for the following code in testing: `unittest.mock`, `mock.Mock()` or `mock.patch`
MSG='Check that unittest.mock is not used (pytest builtin monkeypatch fixture should be used instead)' ; echo $MSG
invgrep -r -E --include '*.py' '(unittest(\.| import )mock|mock\.Mock\(\)|mock\.patch)' pandas/tests/
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5343,7 +5343,7 @@ def __finalize__(
A passed method name providing context on where ``__finalize__``
was called.
.. warning:
.. warning::
The value passed as `method` are not currently considered
stable across pandas releases.
Expand Down

0 comments on commit dd7d290

Please sign in to comment.