Skip to content

Commit

Permalink
ci/vera++/rules/L004: add warning support
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Alamos <[email protected]>
  • Loading branch information
jia200x committed Jan 6, 2021
1 parent da17a1b commit f3a934a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dist/tools/vera++/scripts/rules/L004.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@

set maxLength [getParameter "max-line-length" 100]

#MOD: We add here a line length thershold for line length
set maxLengthWarn [getParameter "max-line-length-warn" 80]

foreach f [getSourceFileNames] {
set lineNumber 1
foreach line [getAllLines $f] {
if {[string length $line] > $maxLength} {
report $f $lineNumber "line is longer than ${maxLength} characters"
} elseif {[string length $line] > $maxLengthWarn} {
# puts won't make vera++ return error code when invoked with --error
puts "$f:$lineNumber: warning: line is longer than $maxLengthWarn characters"
}
incr lineNumber
}
Expand Down

0 comments on commit f3a934a

Please sign in to comment.