File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 3
3
echo " Checking line lengths in all source files <= $MAX_LINE_LENGTH chars..."
4
4
5
5
echo " Offending files and lines:"
6
- (( success = 1 ))
6
+ (( bad_lines = 0 ))
7
+ (( inside_block = 0 ))
7
8
for file in " $@ " ; do
8
9
echo " $file "
9
10
(( line_no = 0 ))
10
11
while IFS=" " read -r line || [[ -n " $line " ]] ; do
11
12
(( line_no++ ))
12
- if (( "${# line} " > $MAX_LINE_LENGTH )) ; then
13
- (( success = 0 ))
13
+ if [[ " $line " =~ ^' ```' ]] ; then
14
+ (( inside_block = ! $inside_block ))
15
+ continue
16
+ fi
17
+ if ! (( $inside_block )) && ! [[ " $line " =~ " | " | " ://" | \[\^ [^\ ]+\] : ]] && (( "${# line} " > $MAX_LINE_LENGTH )) ; then
18
+ (( bad_lines++ ))
14
19
echo -e " \t$line_no : $line "
15
20
fi
16
21
done < " $file "
17
22
done
18
23
19
- (( $success )) && echo " No offending lines found."
24
+ echo " $bad_lines offending lines found."
25
+ (( $bad_lines == 0 ))
You can’t perform that action at this time.
0 commit comments