From 43b95e99d1eadd0c1eb74ad82defd8ba7248f010 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 17 Dec 2019 19:29:49 +0100 Subject: [PATCH] Use 'syntax' as rule name upon syntax errors --- tests/test_cli.py | 2 +- yamllint/linter.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 014cf8f..4244dc8 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -530,7 +530,7 @@ class CommandLineTestCase(unittest.TestCase): 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): diff --git a/yamllint/linter.py b/yamllint/linter.py index fdb3bef..c687f14 100644 --- a/yamllint/linter.py +++ b/yamllint/linter.py @@ -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