Bug 1500447 - [mozlint] Make sure lineno and column are always int (if present), r=rwood
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Fri, 19 Oct 2018 15:54:32 +0000
changeset 500681 96304d13c406be1eb813e7c8cadabd04a8aad12d
parent 500680 0ffed4de7dc0a1ba399a33168e657549d8c559b5
child 500682 95fe4f9c32033b78245886e1e83f70675624977b
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrwood
bugs1500447
milestone64.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 1500447 - [mozlint] Make sure lineno and column are always int (if present), r=rwood This also updates the test for string inputs. Differential Revision: https://phabricator.services.mozilla.com/D9260
python/mozlint/mozlint/result.py
python/mozlint/test/test_formatters.py
--- a/python/mozlint/mozlint/result.py
+++ b/python/mozlint/mozlint/result.py
@@ -77,18 +77,18 @@ class Issue(object):
         'rule',
         'lineoffset',
     )
 
     def __init__(self, linter, path, message, lineno, column=None, hint=None,
                  source=None, level=None, rule=None, lineoffset=None):
         self.path = path
         self.message = message
-        self.lineno = lineno
-        self.column = column
+        self.lineno = int(lineno)
+        self.column = int(column) if column else column
         self.hint = hint
         self.source = source
         self.level = level or 'error'
         self.linter = linter
         self.rule = rule
         self.lineoffset = lineoffset
 
     def __repr__(self):
--- a/python/mozlint/test/test_formatters.py
+++ b/python/mozlint/test/test_formatters.py
@@ -82,18 +82,18 @@ def result(scope='module'):
             lineno=1,
         ),
         Issue(
             linter='bar',
             path='d/e/f.txt',
             message="oh no bar",
             hint="try baz instead",
             level='warning',
-            lineno=4,
-            column=2,
+            lineno="4",
+            column="2",
             rule="bar-not-allowed",
         ),
         Issue(
             linter='baz',
             path='a/b/c.txt',
             message="oh no baz",
             lineno=4,
             column=10,