view vera/rules/L003.tcl @ 134:88ce5dbf045c

Misc: add tags and build into .hgignore
author David Demelier <markand@malikania.fr>
date Wed, 04 Oct 2017 12:32:48 +0200
parents 0edaba9986ba
children
line wrap: on
line source

#!/usr/bin/tclsh
# No leading and no trailing empty lines

foreach f [getSourceFileNames] {
    set lineCount [getLineCount $f]
    if {$lineCount > 0} {
        set firstLine [getLine $f 1]
        if {[string trim $firstLine] == ""} {
            report $f 1 "leading empty line(s)"
        }

        set lastLine [getLine $f $lineCount]
        if {[string trim $lastLine] == ""} {
            report $f $lineCount "trailing empty line(s)"
        }
    }
}