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
laraross committed Sep 28, 2015
1 parent 8735e39 commit 764a3dc
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 764a3dc

Please sign in to comment.