From 59773b962f6d940e41f1fedbabb4010a4a993df6 Mon Sep 17 00:00:00 2001 From: Nate Silva Date: Tue, 4 Mar 2014 13:40:20 -0800 Subject: [PATCH] handle errors with no ESLint rule reference --- Support/content.ejs | 5 ++++- Support/validate.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Support/content.ejs b/Support/content.ejs index c1946df..8c4ba43 100644 --- a/Support/content.ejs +++ b/Support/content.ejs @@ -67,7 +67,10 @@ <% } %> at line <%= issue.line %> position <%= issue.character %>
- <%= issue.reason %> (<%= issue.shortname %>) + <%= issue.reason %> + <% if (issue.shortname) { %> + (<%= issue.shortname %>) + <% } %>
<% } %> diff --git a/Support/validate.py b/Support/validate.py index b780003..4d45af0 100755 --- a/Support/validate.py +++ b/Support/validate.py @@ -294,8 +294,10 @@ def validate(quiet=False): sys.exit() # parse the results - rx = re.compile('^[^:]+\: line (?P\d+), col (?P\d+), ' + - '(?P\w+) - (?P.+) \((?P\w+)\)$') + + rx = re.compile('^[^:]+\\: line (?P\\d+), ' + + 'col (?P\\d+), ' + + '(?P\\w+) - (?P.+)\\s?(\\((?P\\w+)\\))?$') issues = [] @@ -313,10 +315,12 @@ def validate(quiet=False): 'line': int(m.group('line')), 'character': int(m.group('character')) + 1, 'code': m.group('code'), - 'reason': m.group('reason'), - 'shortname': m.group('shortname') + 'reason': m.group('reason') } + if m.group('shortname'): + issue['shortname'] = m.group('shortname') + issues.append(issue) # normalize line numbers