Skip to content

Commit 4b1228c

Browse files
committed
make verifs: Do not wait indefinitely on stdin when nothing changed.
1 parent b3367a2 commit 4b1228c

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

.scripts/check-headers.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
if [ -z "$*" ]
4+
then
5+
exit 0
6+
fi
7+
8+
grep -L '^# Copyright (C) [0-9-]*, Python Software Foundation' $* | while read -r file
9+
do
10+
echo "Please update the po comment in $file"
11+
done
12+
grep -L '^"Project-Id-Version: Python 3\\n"$' $* | while read -r file
13+
do
14+
echo "Please update the 'Project-Id-Version' header in $file"
15+
done
16+
grep -L '^"Language: fr\\n"$' $* | while read -r file
17+
do
18+
echo "Please update the 'Language' header in $file"
19+
done
20+
grep -L '^"Language-Team: FRENCH <[email protected]>\\n"' $* | while read -r file
21+
do
22+
echo "Please update the 'Language-Team' header in $file"
23+
done

Makefile

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ spell: ensure_test_prerequisites $(DESTS)
150150
.PHONY: line-length
151151
line-length:
152152
@echo Checking line length...
153-
@python .scripts/line-length.py $(SRCS)
153+
@if [ -n "$(SRCS)" ]; then python .scripts/line-length.py $(SRCS); fi
154154

155155
.PHONY: sphinx-lint
156156
sphinx-lint: ensure_test_prerequisites
157157
@echo Checking reStructuredText syntax...
158-
@sphinx-lint --enable all --disable line-too-long $(SRCS)
158+
@if [ -n "$(SRCS)" ]; then sphinx-lint --enable all --disable line-too-long $(SRCS); fi
159159

160160
$(POSPELL_TMP_DIR)/%.po.out: %.po dict
161161
@echo "Pospell checking $<..."
@@ -169,22 +169,7 @@ fuzzy: ensure_test_prerequisites
169169
.PHONY: check-headers
170170
check-headers:
171171
@echo Checking po headers...
172-
@grep -L '^# Copyright (C) [0-9-]*, Python Software Foundation' $(SRCS) | while read -r file;\
173-
do \
174-
echo "Please update the po comment in $$file"; \
175-
done
176-
@grep -L '^"Project-Id-Version: Python 3\\n"$$' $(SRCS) | while read -r file;\
177-
do \
178-
echo "Please update the 'Project-Id-Version' header in $$file"; \
179-
done
180-
@grep -L '^"Language: fr\\n"$$' $(SRCS) | while read -r file;\
181-
do \
182-
echo "Please update the 'Language' header in $$file"; \
183-
done
184-
@grep -L '^"Language-Team: FRENCH <[email protected]>\\n"' $(SRCS) | while read -r file;\
185-
do \
186-
echo "Please update the 'Language-Team' header in $$file"; \
187-
done
172+
@sh .scripts/check-headers.sh $(SRCS)
188173

189174
.PHONY: check-colons
190175
check-colons:

0 commit comments

Comments
 (0)