Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix off-by-one line number in compact output #47

Closed
wants to merge 1 commit into from

Conversation

mikaraunio
Copy link

Line numbers in compact output are higher by one compared to json and stylish outputs. This fixes that.

The + 1 looks intentional so was worried this change could break something else. However IssueLocation.__str__() is only called from Issue.__str__() which is only used in format_compact() so this should be safe.

Lint and tests pass.

@thibaudcolas
Copy link
Owner

Hey @mikaraunio, thank you for taking a look at this. I’m surprised this change would be appropriate – last time I troubleshooted this the compact output was the only one that was correct IIRC.

@mikaraunio
Copy link
Author

Hi @thibaudcolas. The compact output would be the correct one if line numbers were always 0-indexed before the + 1, however this appears not to be the case as discussed in issue #22. In any case, do believe that line numbers should be consistent between output formats.

@mikaraunio
Copy link
Author

Closing as per discussion in #22.

@mikaraunio mikaraunio closed this Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants