Skip to content

Commit

Permalink
handle errors with no ESLint rule reference
Browse files Browse the repository at this point in the history
  • Loading branch information
natesilva committed Mar 4, 2014
1 parent 4a19b74 commit 59773b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Support/content.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@
<% } %>
<a href="<%= issue.url %>">at line <%= issue.line %> position <%= issue.character %></a>
<div><tt>
<%= issue.reason %> (<a href="http://eslint.org/docs/rules/<%= issue.shortname %>.html" class="open-external"><%= issue.shortname %></a>)
<%= issue.reason %>
<% if (issue.shortname) { %>
(<a href="http://eslint.org/docs/rules/<%= issue.shortname %>.html" class="open-external"><%= issue.shortname %></a>)
<% } %>
</tt></div>
</li>
<% } %>
Expand Down
12 changes: 8 additions & 4 deletions Support/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,10 @@ def validate(quiet=False):
sys.exit()

# parse the results
rx = re.compile('^[^:]+\: line (?P<line>\d+), col (?P<character>\d+), ' +
'(?P<code>\w+) - (?P<reason>.+) \((?P<shortname>\w+)\)$')

rx = re.compile('^[^:]+\\: line (?P<line>\\d+), ' +
'col (?P<character>\\d+), ' +
'(?P<code>\\w+) - (?P<reason>.+)\\s?(\\((?P<shortname>\\w+)\\))?$')

issues = []

Expand All @@ -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
Expand Down

0 comments on commit 59773b9

Please sign in to comment.