Bug 1579845 - Ride along: Add the line number in the file whitespace lint r=ahal
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 12 Sep 2019 07:01:50 +0000
changeset 492750 9c621b8602f1597143594c7e64d3a940edd95ab7
parent 492749 8b1d6ad6acdc76e70041b2c485d5943be34b34fb
child 492751 2e6f8b858af7f55dcef9dc4af05c8f3250e5710b
push id36566
push userncsoregi@mozilla.com
push dateThu, 12 Sep 2019 15:24:49 +0000
treeherdermozilla-central@6aec99b90f85 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1579845
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1579845 - Ride along: Add the line number in the file whitespace lint r=ahal Differential Revision: https://phabricator.services.mozilla.com/D45447
tools/lint/file-whitespace/__init__.py
--- a/tools/lint/file-whitespace/__init__.py
+++ b/tools/lint/file-whitespace/__init__.py
@@ -22,17 +22,18 @@ def lint(paths, config, fix=None, **lint
                     # We found a trailing whitespace
                     if fix:
                         # We want to fix it, strip the trailing spaces
                         content_to_write.append(line.rstrip() + "\n")
                         hasFix = True
                     else:
                         res = {'path': f,
                                'message': "Trailing whitespace",
-                               'level': 'error'
+                               'level': 'error',
+                               'lineno': i + 1,
                                }
                         results.append(result.from_config(config, **res))
                 else:
                     if fix:
                         content_to_write.append(line)
             if hasFix:
                 # Only update the file when we found a change to make
                 with open(f, 'wb') as open_file_to_write: