Permalink
Browse files

MarkdownBear: Improve result message

Improves the result message by modifying the regex and ignoring
the non-crucial output obtained from the linter.
  • Loading branch information...
yash-nisar committed Jul 16, 2017
1 parent d83fe5f commit 71f6bc543160f280b96a3eeb0a76c60237893922
Showing with 3 additions and 6 deletions.
  1. +1 −1 bears/markdown/MarkdownBear.py
  2. +2 −5 tests/markdown/MarkdownBearTest.py
@@ -29,7 +29,7 @@ class MarkdownBear:
_output_regex = re.compile(
r'\s*(?P<line>\d+):(?P<column>\d+)'
r'\s*(?P<severity>warning)\s*(?P<message>.*)')
r'\s*(?P<severity>warning)\s*(?P<message>.+?)(?: .*|\n|$)')
@staticmethod
@deprecate_settings(bullets='markdown_bullets',
@@ -62,8 +62,7 @@ def test_invalid_message(self):
with prepare_file(content, None) as (file, fname):
with execute_bear(self.uut, fname, file) as results:
self.assertEqual(results[0].message,
'Line must be at most 10 characters'
' maximum-line-length remark-lint')
'Line must be at most 10 characters')
self.assertEqual(results[0].severity, RESULT_SEVERITY.NORMAL)
def test_invalid_link(self):
@@ -72,9 +71,7 @@ def test_invalid_link(self):
with prepare_file(content, None) as (file, fname):
with execute_bear(self.uut, fname, file) as results:
self.assertEqual(results[0].message,
'Link to unknown heading: `world`'
' remark-validate-links '
'remark-validate-links')
'Link to unknown heading: `world`')
self.assertEqual(results[0].severity, RESULT_SEVERITY.NORMAL)
def test_valid_link(self):

0 comments on commit 71f6bc5

Please sign in to comment.