File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 33echo " Checking line lengths in all source files <= $MAX_LINE_LENGTH chars..."
44
55echo " Offending files and lines:"
6- (( success = 1 ))
6+ (( bad_lines = 0 ))
7+ (( inside_block = 0 ))
78for file in " $@ " ; do
89 echo " $file "
910 (( line_no = 0 ))
1011 while IFS=" " read -r line || [[ -n " $line " ]] ; do
1112 (( 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++ ))
1419 echo -e " \t$line_no : $line "
1520 fi
1621 done < " $file "
1722done
1823
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