Skip to content

Commit

Permalink
Merge pull request swcarpentry#228 from r-gaia-cs/core-fix-gloss-check
Browse files Browse the repository at this point in the history
Fix check of glossary item
  • Loading branch information
Raniere Silva committed May 1, 2015
2 parents e8e144b + 45dbfcd commit c70bebd
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions tools/check.py
Expand Up @@ -565,24 +565,14 @@ def _validate_glossary_entry(self, glossary_entry):

entry_is_valid = True
for line_index, line in enumerate(glossary_entry):
if line_index == 1:
if not re.match("^: ", line):
logging.error(
"In {0}: "
"At glossary entry '{1}' "
"First line of definition must "
"start with ': '.".format(
self.filename, glossary_keyword))
entry_is_valid = False
elif line_index > 1:
if not re.match("^ ", line):
logging.error(
"In {0}: "
"At glossary entry '{1}' "
"Subsequent lines of definition must "
"start with ' '.".format(
self.filename, glossary_keyword, ))
entry_is_valid = False
if line_index == 1 and not re.match("^: ", line):
logging.error(
"In {0}: "
"At glossary entry '{1}' "
"First line of definition must "
"start with ': '.".format(
self.filename, glossary_keyword))
entry_is_valid = False
return entry_is_valid

def _validate_glossary(self):
Expand Down

0 comments on commit c70bebd

Please sign in to comment.