summaryrefslogtreecommitdiff
path: root/misc/hooks/pre-commit-make-rst
diff options
context:
space:
mode:
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