Revision 674711de autotools/check-python-code
b/autotools/check-python-code | ||
---|---|---|
20 | 20 |
|
21 | 21 |
set -e |
22 | 22 |
|
23 |
readonly maxlinelen=$(for ((i=0; i<81; ++i)); do echo -n .; done) |
|
24 |
|
|
25 |
if [[ "${#maxlinelen}" != 81 ]]; then |
|
26 |
echo "Internal error: Check for line length is incorrect" >&2 |
|
27 |
exit 1 |
|
28 |
fi |
|
29 |
|
|
23 | 30 |
# "[...] If the last ARG evaluates to 0, let returns 1; 0 is returned |
24 | 31 |
# otherwise.", hence ignoring the return value. |
25 | 32 |
let problems=0 || : |
... | ... | |
47 | 54 |
echo "Found editor-specific settings in $script" >&2 |
48 | 55 |
fi |
49 | 56 |
|
50 |
if [[ "$(wc --max-line-length < "$script")" -gt 80 ]]; then
|
|
57 |
if grep -n -H "^$maxlinelen" "$script"; then
|
|
51 | 58 |
let ++problems |
52 | 59 |
echo "Longest line in $script is longer than 80 characters" >&2 |
53 | 60 |
fi |
Also available in: Unified diff