# HG changeset patch # User Andrew Halberstadt # Date 1539964472 0 # Node ID 96304d13c406be1eb813e7c8cadabd04a8aad12d # Parent 46176eb8152bc6be974ec360434b40821d2fd60b 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 diff --git a/python/mozlint/mozlint/result.py b/python/mozlint/mozlint/result.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): diff --git a/python/mozlint/test/test_formatters.py b/python/mozlint/test/test_formatters.py --- 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,