Skip to content

Commit

Permalink
Use 'syntax' as rule name upon syntax errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvestre authored and adrienverge committed Dec 17, 2019
1 parent 8fa9eb3 commit 43b95e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_cli.py
Expand Up @@ -530,7 +530,7 @@ def test_run_read_from_stdin(self):
out, err = sys.stdout.getvalue(), sys.stderr.getvalue()
self.assertEqual(out, (
'stdin:2:10: [error] syntax error: '
'mapping values are not allowed here\n'))
'mapping values are not allowed here (syntax)\n'))
self.assertEqual(err, '')

def test_run_no_warnings(self):
Expand Down
2 changes: 1 addition & 1 deletion yamllint/linter.py
Expand Up @@ -180,7 +180,7 @@ def get_syntax_error(buffer):
except yaml.error.MarkedYAMLError as e:
problem = LintProblem(e.problem_mark.line + 1,
e.problem_mark.column + 1,
'syntax error: ' + e.problem)
'syntax error: ' + e.problem + ' (syntax)')
problem.level = 'error'
return problem

Expand Down

0 comments on commit 43b95e9

Please sign in to comment.