[MacPorts] #14165: port lint complains about trailing spaces on blank lines

MacPorts trac at macosforge.org
Sun Feb 3 11:16:25 PST 2008


#14165: port lint complains about trailing spaces on blank lines
-------------------------------------+--------------------------------------
 Reporter:  ryandesign at macports.org  |       Owner:  ryandesign at macports.org
     Type:  defect                   |      Status:  new                    
 Priority:  Normal                   |   Milestone:  MacPorts base bugs     
Component:  base                     |     Version:  1.7.0                  
 Keywords:                           |  
-------------------------------------+--------------------------------------
 When first implemented, `port lint` complained about trailing whitespace
 on blank lines. The code in portlint.tcl checked for this condition to
 decide whether to print the warning:

 {{{
 [string match "* " $line] || [string match "*\t" $line]
 }}}

 afb committed r28568 which was supposed to fix it, by changing the check
 to this:

 {{{
 [string match "* " $line] || [string match "*\t" $line] && [string trim
 $line] != ""
 }}}

 But in fact, this only fixed it if the trailing whitespace was a tab. If
 the trailing whitespace was a space, the erroneous warning is still
 printed. The check should have been:

 {{{
 ([string match "* " $line] || [string match "*\t" $line]) && [string trim
 $line] != ""
 }}}

 But this can all be simplified to a single regular expression:

 {{{
 [regexp {\S[ \t]+$} $line]
 }}}

-- 
Ticket URL: <http://trac.macosforge.org/projects/macports/ticket/14165>
MacPorts </projects/macports>
Ports system for Mac OS


More information about the macports-tickets mailing list