[41170] trunk/base/src/port1.0/portlint.tcl

ryandesign at macports.org ryandesign at macports.org
Sun Oct 26 18:32:41 PDT 2008


Revision: 41170
          http://trac.macports.org/changeset/41170
Author:   ryandesign at macports.org
Date:     2008-10-26 18:32:41 -0700 (Sun, 26 Oct 2008)
Log Message:
-----------
portlint.tcl: No longer nitpick whitespace or patchfile names unless the nitpick option is enabled. There is currently no way to enable this option. A future revision should provide a way to do so. See issue #14799.

Modified Paths:
--------------
    trunk/base/src/port1.0/portlint.tcl

Modified: trunk/base/src/port1.0/portlint.tcl
===================================================================
--- trunk/base/src/port1.0/portlint.tcl	2008-10-27 01:31:17 UTC (rev 41169)
+++ trunk/base/src/port1.0/portlint.tcl	2008-10-27 01:32:41 UTC (rev 41170)
@@ -161,6 +161,8 @@
 
     ###################################################################
     ui_debug "$portfile"
+    
+    set nitpick false
 
     set topline_number 1
     set require_blank false
@@ -178,11 +180,13 @@
     while {1} {
         set line [gets $f]
         if {[eof $f]} {
-            seek $f -1 end
-            set last [read $f 1]
-            if {![string match "\n" $last]} {
-                ui_warn "Line $lineno has missing newline (at end of file)"
-                incr warnings
+            if {$nitpick} {
+                seek $f -1 end
+                set last [read $f 1]
+                if {![string match "\n" $last]} {
+                    ui_warn "Line $lineno has missing newline (at end of file)"
+                    incr warnings
+                }
             }
             close $f
             break
@@ -199,13 +203,13 @@
             set require_blank false
         }
 
-        if {$require_blank && ($line != "")} {
+        if {$nitpick && $require_blank && ($line != "")} {
             ui_warn "Line $lineno should be a newline (after $require_after)"
             incr warnings
         }
         set require_blank false
 
-        if {[regexp {\S[ \t]+$} $line]} {
+        if {$nitpick && [regexp {\S[ \t]+$} $line]} {
             # allow indented blank lines between blocks of code and such
             ui_warn "Line $lineno has trailing whitespace before newline"
             incr warnings
@@ -482,7 +486,7 @@
         ui_info "OK: Portfile directory matches port name"
     }
 
-    if {[info exists patchfiles]} {
+    if {$nitpick && [info exists patchfiles]} {
         foreach patchfile $patchfiles {
             if {![string match "patch-*.diff" $patchfile] && [file exists "$portpath/files/$patchfile"]} {
                 ui_warn "Patchfile $patchfile does not follow the source patch naming policy \"patch-*.diff\""
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081026/704f2b90/attachment-0001.html>


More information about the macports-changes mailing list