Mercurial > malikania
view vera/rules/L001.tcl @ 154:614ac46dac3e
Client: add basic network support
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 13 Dec 2017 13:48:56 +0100 |
parents | 0edaba9986ba |
children |
line wrap: on
line source
#!/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 {^.*\r$} $line] { report $f $lineNumber "CRLF line ending" set line [string range $line 0 end-1] } if [regexp {^.*[[:space:]]+$} $line] { if {$strictMode || [string trim $line] != "" || $line != $previousIndent} { report $f $lineNumber "trailing whitespace" } } regexp {^([[:space:]]*).*$} $line dummy previousIndent incr lineNumber } }