From 8f05e26198d6b8bcf620f2e87ca671bb74cf82de Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Sun, 24 Oct 2021 01:48:03 -0500 Subject: Rename "makerst.py" to "make_rst.py" --- misc/hooks/README.md | 4 ++-- misc/hooks/pre-commit | 2 +- misc/hooks/pre-commit-make-rst | 12 ++++++++++++ misc/hooks/pre-commit-makerst | 12 ------------ 4 files changed, 15 insertions(+), 15 deletions(-) create mode 100755 misc/hooks/pre-commit-make-rst delete mode 100755 misc/hooks/pre-commit-makerst (limited to 'misc/hooks') diff --git a/misc/hooks/README.md b/misc/hooks/README.md index 5661c239ed..e420c6cb5c 100644 --- a/misc/hooks/README.md +++ b/misc/hooks/README.md @@ -12,8 +12,8 @@ contributors to make sure they comply with our requirements. `PATH`, or if you want to enable colored output with `pygmentize`. - Pre-commit hook for `black`: Applies `black` to the staged Python files before accepting a commit. -- Pre-commit hook for `makerst`: Checks the class reference syntax using - `makerst.py`. +- Pre-commit hook for `make_rst`: Checks the class reference syntax using + `make_rst.py`. ## Installation diff --git a/misc/hooks/pre-commit b/misc/hooks/pre-commit index 40cb00253b..ab0fc8176f 100755 --- a/misc/hooks/pre-commit +++ b/misc/hooks/pre-commit @@ -14,7 +14,7 @@ # as this script. Hooks should return 0 if successful and nonzero to cancel the # commit. They are executed in the order in which they are listed. #HOOKS="pre-commit-compile pre-commit-uncrustify" -HOOKS="pre-commit-clang-format pre-commit-black pre-commit-makerst" +HOOKS="pre-commit-clang-format pre-commit-black pre-commit-make-rst" ########################################################### # There should be no need to change anything below this line. 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 diff --git a/misc/hooks/pre-commit-makerst b/misc/hooks/pre-commit-makerst deleted file mode 100755 index b990788b99..0000000000 --- a/misc/hooks/pre-commit-makerst +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# Git pre-commit hook that checks the class reference syntax using makerst.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/makerst.py doc/classes modules --dry-run -- cgit v1.2.3