Skip to content

report columns in 1-based, not 0-based #4482

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

Merged
merged 3 commits into from
Jan 20, 2018

Conversation

elliott-beach
Copy link
Contributor

fixes #4475

@elliott-beach elliott-beach changed the title report columns as 1 based report columns in 1-based, not 0-based Jan 18, 2018
mypy/errors.py Outdated
@@ -411,7 +411,8 @@ def format_messages(self, error_info: List[ErrorInfo]) -> List[str]:
if file is not None:
if self.show_column_numbers and line is not None and line >= 0 \
and column is not None and column >= 0:
srcloc = '{}:{}:{}'.format(file, line, column)
col = 1 + column
srcloc = '{}:{}:{}'.format(file, line, col)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why you're not just inlining column + 1 here?

@elliott-beach
Copy link
Contributor Author

elliott-beach commented Jan 18, 2018 via email

@gvanrossum
Copy link
Member

No good deed goes unpunished, flake8 wants spaces around the +.

@gvanrossum gvanrossum merged commit 68aeb92 into python:master Jan 20, 2018
@gvanrossum
Copy link
Member

Thanks!

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.

Are column numbers base-0 or base-1?
2 participants