FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Carry back fixes found while syncing 3.14 · python/python-docs-de@0e46515 · GitHub

Commit 0e46515

Browse files
committed
Carry back fixes found while syncing 3.14
1 parent 50fc909 commit 0e46515

2 files changed

Lines changed: 432 additions & 421 deletions

File tree

‎pre_push_check.sh‎

100644100755
Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ fi
5858

5959
pass=0
6060
fail=0
61+
skip=0
6162

6263
log_section() { echo; echo "=== $1 ==="; }
6364
is_excluded() {
@@ -81,6 +82,7 @@ if $RUN_QUICK; then
8182
log_section "1a/5 powrap (Zeilenumbruch auf 80 Zeichen)"
8283
if ! command -v powrap &>/dev/null; then
8384
echo "powrap nicht gefunden -- installiere mit: pip install powrap"
85+
skip=$((skip + 1))
8486
else
8587
# Die CI formatiert nach jedem Push automatisch mit powrap und
8688
# committet das Ergebnis. Wer lokal nicht formatiert, bekommt beim
@@ -97,8 +99,15 @@ if $RUN_QUICK; then
9799
fi
98100

99101
log_section "1b/5 msgfmt --check (Syntax)"
100-
msgfmt_errors=0
102+
if ! command -v msgfmt &>/dev/null; then
103+
echo "msgfmt nicht gefunden -- gehoert zu gettext (brew install gettext)."
104+
echo "Schritt uebersprungen."
105+
skip=$((skip + 1))
106+
msgfmt_errors=-1
107+
fi
108+
msgfmt_errors=${msgfmt_errors:-0}
101109
while IFS= read -r -d '' po; do
110+
[[ $msgfmt_errors -lt 0 ]] && break
102111
rel="${po#"$REPO_ROOT"/}"
103112
is_excluded "$rel" && continue
104113
if ! out=$(msgfmt --check --check-format -o /dev/null "$po" 2>&1); then
@@ -107,7 +116,9 @@ if $RUN_QUICK; then
107116
msgfmt_errors=$((msgfmt_errors + 1))
108117
fi
109118
done < <(find "$REPO_ROOT" -name "*.po" -print0)
110-
if [[ $msgfmt_errors -eq 0 ]]; then
119+
if [[ $msgfmt_errors -lt 0 ]]; then
120+
:
121+
elif [[ $msgfmt_errors -eq 0 ]]; then
111122
echo "OK -- keine Syntaxfehler."
112123
pass=$((pass + 1))
113124
else
@@ -118,7 +129,7 @@ if $RUN_QUICK; then
118129
log_section "1c/5 sphinx-lint (Backtick-/Rollen-Syntax)"
119130
if ! command -v sphinx-lint &>/dev/null; then
120131
echo "sphinx-lint nicht gefunden -- installiere mit: pip install sphinx-lint"
121-
fail=$((fail + 1))
132+
skip=$((skip + 1))
122133
else
123134
lint_targets=()
124135
while IFS= read -r -d '' po; do
@@ -139,6 +150,7 @@ if $RUN_QUICK; then
139150
log_section "1d/5 Rollen-Konsistenz (eigener Check, kein Build noetig)"
140151
if [[ ! -f "$CHECK_ROLES_PY" ]]; then
141152
echo "check_roles.py nicht gefunden unter $CHECK_ROLES_PY -- Schritt uebersprungen."
153+
skip=$((skip + 1))
142154
else
143155
if python3 "$CHECK_ROLES_PY" "$REPO_ROOT" --exclude "$(IFS=,; echo "${EXCLUDE_DIRS[*]}")"; then
144156
pass=$((pass + 1))
@@ -150,6 +162,7 @@ if $RUN_QUICK; then
150162
log_section "1e/5 Auszeichnung (ueberfluessige Backticks, Codebloecke, Literale)"
151163
if [[ ! -f "$CHECK_MARKUP_PY" ]]; then
152164
echo "check_markup.py nicht gefunden unter $CHECK_MARKUP_PY -- Schritt uebersprungen."
165+
skip=$((skip + 1))
153166
else
154167
if python3 "$CHECK_MARKUP_PY" "$REPO_ROOT" \
155168
--exclude "$(IFS=,; echo "${EXCLUDE_DIRS[*]}")" --max 10; then
@@ -240,7 +253,10 @@ if [[ $pass -eq 0 && $fail -eq 0 ]]; then
240253
echo "Keine Pruefungen durchgefuehrt."
241254
exit 0
242255
fi
243-
echo "Bestanden: $pass Fehlgeschlagen: $fail"
256+
echo "Bestanden: $pass Fehlgeschlagen: $fail Uebersprungen: $skip"
257+
if [[ $skip -gt 0 ]]; then
258+
echo "Achtung: $skip Pruefung(en) konnten mangels Werkzeug nicht laufen."
259+
fi
244260
if [[ $fail -eq 0 ]]; then
245261
echo "Alles sauber -- bereit zum Push."
246262
exit 0

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL