Skip to content

Commit aeef4cd

Browse files
nikomatsakismark-i-m
authored andcommitted
make the script give more useful feedback
1 parent e6acd30 commit aeef4cd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

ci/check_line_lengths.sh

+16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/bin/bash
22

3+
if [ "$1" == "--help" ]; then
4+
echo 'Usage:'
5+
echo ' MAX_LINE_LENGTH=80' "$0" 'src/**/*.md'
6+
exit 1
7+
fi
8+
9+
if [ "$MAX_LINE_LENGTH" == "" ]; then
10+
echo '`MAX_LINE_LENGTH` environment variable not set. Try --help.'
11+
exit 1
12+
fi
13+
14+
if [ "$1" == "" ]; then
15+
echo 'No files provided.'
16+
exit 1
17+
fi
18+
319
echo "Checking line lengths in all source files <= $MAX_LINE_LENGTH chars..."
420

521
echo "Offending files and lines:"

0 commit comments

Comments
 (0)