1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/dist/tools/vera++/scripts/rules/L001.tcl
2020-02-14 14:17:16 +01:00

21 lines
532 B
Tcl
Executable File

#!/usr/bin/tclsh
# No trailing whitespace
set strictMode [getParameter "strict-trailing-space" 0]
foreach f [getSourceFileNames] {
set lineNumber 1
set previousIndent ""
foreach line [getAllLines $f] {
if [regexp {^.*[[:space:]]+$} $line] {
if {$strictMode || [string trim $line] != "" || $line != $previousIndent} {
report $f $lineNumber "trailing whitespace"
}
}
regexp {^([[:space:]]*).*$} $line dummy previousIndent
incr lineNumber
}
}