From 0b3706702f647e252bd6a7a068c03bd5d717e550 Mon Sep 17 00:00:00 2001 From: Raniere Silva Date: Sat, 13 Dec 2014 16:42:48 -0200 Subject: [PATCH] Improve message for glossary error --- tools/check | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/check b/tools/check index 23261b6..a571696 100755 --- a/tools/check +++ b/tools/check @@ -426,13 +426,14 @@ class ReferencePageValidator(MarkdownValidator): ```definition_lists``` extension. That syntax isn't supported by the CommonMark parser, so we identify - terms manually.""" + terms manually.""" + glossary_keyword = glossary_entry[0] if len(glossary_entry) < 2: logging.error( "In {0}:" - "Glossary entry must have at least two lines- " + "Glossary entry \"{}\" must have at least two lines- " "a term and a definition.".format( - self.filename)) + glossary_keyword, self.filename)) return False entry_is_valid = True @@ -441,17 +442,19 @@ class ReferencePageValidator(MarkdownValidator): if not re.match("^: ", line): logging.error( "In {0}:" + "At glossary entry \"{}\" " "First line of definition must " "start with ': '.".format( - self.filename)) + glossary_keyword, self.filename)) entry_is_valid = False elif line_index > 1: if not re.match("^ ", line): logging.error( "In {0}:" + "At glossary entry \"{}\" " "Subsequent lines of definition must " "start with ' '.".format( - self.filename)) + glossary_keyword, self.filename)) entry_is_valid = False return entry_is_valid -- GitLab