summaryrefslogtreecommitdiff
path: root/misc/hooks/pre-commit-make-rst
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-10-24 01:48:03 -0500
committerAaron Franke <arnfranke@yahoo.com>2021-10-24 01:58:59 -0500
commit8f05e26198d6b8bcf620f2e87ca671bb74cf82de (patch)
tree58c5112e19d1d475bfbc6b7090ad69d375e136ad /misc/hooks/pre-commit-make-rst
parentb2ab5cb504cef1ffe229523d63b997d5306afce3 (diff)
Rename "makerst.py" to "make_rst.py"
Diffstat (limited to 'misc/hooks/pre-commit-make-rst')
-rwxr-xr-xmisc/hooks/pre-commit-make-rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/misc/hooks/pre-commit-make-rst b/misc/hooks/pre-commit-make-rst
new file mode 100755
index 0000000000..38b397c494
--- /dev/null
+++ b/misc/hooks/pre-commit-make-rst
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+# Git pre-commit hook that checks the class reference syntax using make_rst.py.
+
+# Workaround because we can't execute the .py file directly on windows
+PYTHON=python
+py_ver=$($PYTHON -c "import sys; print(sys.version_info.major)")
+if [[ "$py_ver" != "3" ]]; then
+ PYTHON+=3
+fi
+
+$PYTHON doc/tools/make_rst.py doc/classes modules --dry-run