Skip to content

Commit dd7d290

Browse files
MarcoGorelliJulianWgs
authored andcommitted
CI move check incorrect sphinx directives to pre-commit (pandas-dev#37136)
1 parent 6d29f54 commit dd7d290

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

.pre-commit-config.yaml

+10-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ repos:
5353
types: [rst]
5454
args: [--filename=*.rst]
5555
additional_dependencies: [flake8-rst==0.7.0, flake8==3.7.9]
56+
- id: incorrect-sphinx-directives
57+
name: Check for incorrect Sphinx directives
58+
language: pygrep
59+
entry: >-
60+
\.\. (autosummary|contents|currentmodule|deprecated
61+
|function|image|important|include|ipython|literalinclude
62+
|math|module|note|raw|seealso|toctree|versionadded
63+
|versionchanged|warning):[^:]
64+
files: \.(py|pyx|rst)$
5665
- repo: https://github.com/asottile/yesqa
5766
rev: v1.2.2
5867
hooks:
@@ -61,4 +70,4 @@ repos:
6170
rev: v3.2.0
6271
hooks:
6372
- id: end-of-file-fixer
64-
exclude: '.html$|^LICENSES/|.csv$|.txt$|.svg$|.py$'
73+
exclude: ^LICENSES/|\.(html|csv|txt|svg|py)$

ci/code_checks.sh

-4
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,6 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
202202
invgrep -R --include="*.rst" -E "[a-zA-Z0-9]\`\`?[a-zA-Z0-9]" doc/source/
203203
RET=$(($RET + $?)) ; echo $MSG "DONE"
204204

205-
MSG='Check for incorrect sphinx directives' ; echo $MSG
206-
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
207-
RET=$(($RET + $?)) ; echo $MSG "DONE"
208-
209205
# Check for the following code in testing: `unittest.mock`, `mock.Mock()` or `mock.patch`
210206
MSG='Check that unittest.mock is not used (pytest builtin monkeypatch fixture should be used instead)' ; echo $MSG
211207
invgrep -r -E --include '*.py' '(unittest(\.| import )mock|mock\.Mock\(\)|mock\.patch)' pandas/tests/

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5343,7 +5343,7 @@ def __finalize__(
53435343
A passed method name providing context on where ``__finalize__``
53445344
was called.
53455345
5346-
.. warning:
5346+
.. warning::
53475347
53485348
The value passed as `method` are not currently considered
53495349
stable across pandas releases.

0 commit comments

Comments
 (0)