svn commit: r263773 - user/crees/rclint
Chris Rees
crees at FreeBSD.org
Wed Mar 26 17:43:25 UTC 2014
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()):
More information about the svn-src-user
mailing list