Skip to content

Commit

Permalink
Sort errors by the position of their occurence
Browse files Browse the repository at this point in the history
Closes #12.
  • Loading branch information
Jordan Suchow committed Feb 1, 2015
1 parent ae8cfbc commit 199b8d3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions proselint/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@ def proselint(version, file):
else:
with open(file, "r") as f:
text = f.read()
errors = []
for check in checks:
errors = check(text)
if errors:
for error in errors:
(start, end, error_code, msg) = error
(line, column) = line_and_column(text, start)
log_error(file, line, column, error_code, msg)
errors += check(text)

errors = sorted(errors)

for error in errors:
(start, end, error_code, msg) = error
(line, column) = line_and_column(text, start)
log_error(file, line, column, error_code, msg)

0 comments on commit 199b8d3

Please sign in to comment.