Use 'syntax' as rule name upon syntax errors

pull/220/head
Sylvestre Ledru 5 years ago committed by Adrien Vergé
parent 8fa9eb3ced
commit 43b95e99d1

@ -530,7 +530,7 @@ class CommandLineTestCase(unittest.TestCase):
out, err = sys.stdout.getvalue(), sys.stderr.getvalue() out, err = sys.stdout.getvalue(), sys.stderr.getvalue()
self.assertEqual(out, ( self.assertEqual(out, (
'stdin:2:10: [error] syntax error: ' 'stdin:2:10: [error] syntax error: '
'mapping values are not allowed here\n')) 'mapping values are not allowed here (syntax)\n'))
self.assertEqual(err, '') self.assertEqual(err, '')
def test_run_no_warnings(self): def test_run_no_warnings(self):

@ -180,7 +180,7 @@ def get_syntax_error(buffer):
except yaml.error.MarkedYAMLError as e: except yaml.error.MarkedYAMLError as e:
problem = LintProblem(e.problem_mark.line + 1, problem = LintProblem(e.problem_mark.line + 1,
e.problem_mark.column + 1, e.problem_mark.column + 1,
'syntax error: ' + e.problem) 'syntax error: ' + e.problem + ' (syntax)')
problem.level = 'error' problem.level = 'error'
return problem return problem

Loading…
Cancel
Save