Skip to content

Commit dfac0cc

Browse files
authored
GH-46546: [CI][Dev][Python] Use pre-commit for numpydoc (#46595)
### Rationale for this change We want to migrate to pre-commit from `archery lint`. ### What changes are included in this PR? Use pre-commit for numpydoc but this doesn't support Cython files. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: #46546 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 19aadb2 commit dfac0cc

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,25 @@ repos:
168168
?.pb\.(cc|h)$|
169169
?^cpp/src/generated/|
170170
)
171+
- repo: https://github.com/numpy/numpydoc
172+
rev: v1.8.0
173+
hooks:
174+
- id: numpydoc-validation
175+
name: Python (NumPy doc) Lint
176+
alias: python-doc-lint
177+
args:
178+
- "--config=python"
179+
files: >-
180+
^python/pyarrow/
181+
exclude: >-
182+
(
183+
?^python/pyarrow/interchange/from_dataframe\.py$|
184+
?^python/pyarrow/jvm\.py$|
185+
?^python/pyarrow/pandas_compat\.py$|
186+
?^python/pyarrow/tests/|
187+
?^python/pyarrow/util\.py$|
188+
?^python/pyarrow/vendored/|
189+
)
171190
- repo: local
172191
hooks:
173192
- id: lintr

python/pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ test = [
6565
'pandas'
6666
]
6767

68+
[tool.numpydoc_validation]
69+
checks = [
70+
"GL10",
71+
"PR01",
72+
"PR03",
73+
"PR04",
74+
"PR05",
75+
"PR10",
76+
"RT03",
77+
"YD01",
78+
]
79+
exclude = [
80+
'\._.*$',
81+
]
82+
6883
[tool.setuptools]
6984
zip-safe=false
7085
include-package-data=true

0 commit comments

Comments
 (0)