view vera/rules/L004.tcl @ 136:835c8ee3f9e5

Docs: use ``` as fenced code blocks
author David Demelier <markand@malikania.fr>
date Fri, 20 Oct 2017 11:44:57 +0200
parents 0edaba9986ba
children
line wrap: on
line source

#!/usr/bin/tclsh
# Line cannot be too long

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

foreach f [getSourceFileNames] {
    set lineNumber 1
    foreach line [getAllLines $f] {
        if {[string length $line] > $maxLength} {
            report $f $lineNumber "line is longer than ${maxLength} characters"
        }
        incr lineNumber
    }
}