Skip to content

Commit

Permalink
fix: report errors on line 0 instead of 1
Browse files Browse the repository at this point in the history
Closes #73
  • Loading branch information
andreoliwa committed Aug 13, 2019
1 parent 28cbd98 commit 31b13ea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/nitpick/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def flake8_error(self, number: int, message: str, suggestion: str = None, add_to
from nitpick.plugin import NitpickChecker

return (
1,
0,
0,
"{}{:03d} {}{}{}".format(
ERROR_PREFIX, joined_number, self.error_prefix, message.rstrip(), suggestion_with_newline
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def lint(self, file_index: int = 0) -> "ProjectMock":
self._errors = set()
for flake8_error in self._original_errors:
line, col, message, class_ = flake8_error
if not (line == 1 and col == 0 and message.startswith(ERROR_PREFIX) and class_ is NitpickChecker):
if not (line == 0 and col == 0 and message.startswith(ERROR_PREFIX) and class_ is NitpickChecker):
raise AssertionError()
self._errors.add(message)
return self
Expand Down

0 comments on commit 31b13ea

Please sign in to comment.