Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Mar 2014 17:43:25 +0000 (UTC)
From:      Chris Rees <crees@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r263773 - user/crees/rclint
Message-ID:  <201403261743.s2QHhPFP004283@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: crees (doc,ports committer)
Date: Wed Mar 26 17:43:24 2014
New Revision: 263773
URL: http://svnweb.freebsd.org/changeset/base/263773

Log:
  Give the line number of the first out-of-order line found.

Modified:
  user/crees/rclint/rclint.py

Modified: user/crees/rclint/rclint.py
==============================================================================
--- user/crees/rclint/rclint.py	Wed Mar 26 17:40:13 2014	(r263772)
+++ user/crees/rclint/rclint.py	Wed Mar 26 17:43:24 2014	(r263773)
@@ -27,8 +27,8 @@
 __version__ = '$FreeBSD$'
 
 MAJOR = 0
-MINOR = 0
-MICRO = 6
+MINOR = 1
+MICRO = 0
 
 DATADIR = '.'
 
@@ -361,8 +361,14 @@ def do_rclint(filename):
         if s.type == 'run_rc_command':
             linenumbers.append(s.line)
 
-    if sorted(linenumbers) != linenumbers:
-        error.give('file_order')
+    # Check lines are in the correct order
+
+    sortedlinenumbers = sorted(linenumbers)
+
+    for i in range(0, len(linenumbers)):
+        if sortedlinenumbers[i] != linenumbers[i]:
+            error.give('file_order', linenumbers[i])
+            break
 
     logging.debug('Checking all lines are accounted for')
     for obj in list(lineobj.keys()):



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403261743.s2QHhPFP004283>