Skip to content

Commit 8d7b6f9

Browse files
authored
[docs] [ci] automatically re-generate parameter docs via pre-commit (#7001)
1 parent 97ff708 commit 8d7b6f9

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.ci/test.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,6 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
139139
linkchecker --config=./docs/.linkcheckerrc ./docs/_build/html/*.html || exit 1
140140
exit 0
141141
fi
142-
# check the consistency of parameters' descriptions and other stuff
143-
cp ./docs/Parameters.rst ./docs/Parameters-backup.rst
144-
cp ./src/io/config_auto.cpp ./src/io/config_auto-backup.cpp
145-
python ./.ci/parameter-generator.py || exit 1
146-
diff ./docs/Parameters-backup.rst ./docs/Parameters.rst || exit 1
147-
diff ./src/io/config_auto-backup.cpp ./src/io/config_auto.cpp || exit 1
148142
exit 0
149143
fi
150144

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ repos:
2727
hooks:
2828
- id: yamllint
2929
args: ["--strict"]
30+
- repo: local
31+
hooks:
32+
- id: regenerate-parameters
33+
name: regenerate-parameters
34+
entry: python
35+
args:
36+
- ./.ci/parameter-generator.py
37+
language: python
38+
pass_filenames: false
3039
- repo: https://github.com/rstcheck/rstcheck
3140
rev: v6.2.5
3241
hooks:

0 commit comments

Comments
 (0)