Skip to content

Commit 210e6d5

Browse files
committed
extensions for typical backtick failures by transifex
1 parent b065b5f commit 210e6d5

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

‎pre_push_check.sh‎

100755100644
Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
# Stufe 1 (immer, ca. 1 Minute): msgfmt-Syntaxcheck + sphinx-lint + eigener
55
# Rollen-Konsistenz-Check (findet die meisten "echten" Bugs wie
66
# falsche/fehlende/ueberzaehlige :ref:/:term:/:class:/... -Rollen,
7-
# OHNE dass ein kompletter Sphinx-Build noetig ist)
7+
# OHNE dass ein kompletter Sphinx-Build noetig ist) + Auszeichnungs-
8+
# pruefung (ueberfluessige Backtick-Klammern, uebersetzte Code-
9+
# bloecke, abweichende ``Literale``)
810
# Stufe 2 (optional, ca. 10-20 Min. auf einem M1 Mac): echter Sphinx-Build
911
# wie in test-build.yml, fuer die letzte Sicherheit vor dem Push
1012
#
@@ -22,6 +24,7 @@ set -uo pipefail
2224
REPO_ROOT="${REPO_ROOT:-$(pwd)}"
2325
CPYTHON_ROOT="${CPYTHON_ROOT:-/Volumes/Dev_SSD/GitHub}"
2426
CHECK_ROLES_PY="${CHECK_ROLES_PY:-$REPO_ROOT/check_roles.py}"
27+
CHECK_MARKUP_PY="${CHECK_MARKUP_PY:-$REPO_ROOT/tools/check_markup.py}"
2528
EXCLUDE_DIRS=("c-api" ".venv" ".git")
2629

2730
BRANCH="$(git -C "$REPO_ROOT" branch --show-current 2>/dev/null)"
@@ -75,7 +78,7 @@ if ! $NONINTERACTIVE; then
7578
fi
7679

7780
if $RUN_QUICK; then
78-
log_section "1a/3 msgfmt --check (Syntax)"
81+
log_section "1a/4 msgfmt --check (Syntax)"
7982
msgfmt_errors=0
8083
while IFS= read -r -d '' po; do
8184
rel="${po#"$REPO_ROOT"/}"
@@ -94,7 +97,7 @@ if $RUN_QUICK; then
9497
fail=$((fail + 1))
9598
fi
9699

97-
log_section "1b/3 sphinx-lint (Backtick-/Rollen-Syntax)"
100+
log_section "1b/4 sphinx-lint (Backtick-/Rollen-Syntax)"
98101
if ! command -v sphinx-lint &>/dev/null; then
99102
echo "sphinx-lint nicht gefunden -- installiere mit: pip install sphinx-lint"
100103
fail=$((fail + 1))
@@ -115,7 +118,7 @@ if $RUN_QUICK; then
115118
fi
116119
fi
117120

118-
log_section "1c/3 Rollen-Konsistenz (eigener Check, kein Build noetig)"
121+
log_section "1c/4 Rollen-Konsistenz (eigener Check, kein Build noetig)"
119122
if [[ ! -f "$CHECK_ROLES_PY" ]]; then
120123
echo "check_roles.py nicht gefunden unter $CHECK_ROLES_PY -- Schritt uebersprungen."
121124
else
@@ -125,6 +128,18 @@ if $RUN_QUICK; then
125128
fail=$((fail + 1))
126129
fi
127130
fi
131+
132+
log_section "1d/4 Auszeichnung (ueberfluessige Backticks, Codebloecke, Literale)"
133+
if [[ ! -f "$CHECK_MARKUP_PY" ]]; then
134+
echo "check_markup.py nicht gefunden unter $CHECK_MARKUP_PY -- Schritt uebersprungen."
135+
else
136+
if python3 "$CHECK_MARKUP_PY" "$REPO_ROOT" \
137+
--exclude "$(IFS=,; echo "${EXCLUDE_DIRS[*]}")" --max 10; then
138+
pass=$((pass + 1))
139+
else
140+
fail=$((fail + 1))
141+
fi
142+
fi
128143
fi
129144

130145
if ! $NONINTERACTIVE; then

0 commit comments

Comments
 (0)