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

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

Merged
merged 3 commits into from Jan 20, 2018

Conversation

Projects
None yet
2 participants
@elliott-beach
Contributor

elliott-beach commented Jan 18, 2018

fixes #4475

@elliott-beach elliott-beach changed the title from report columns as 1 based to report columns in 1-based, not 0-based Jan 18, 2018

@@ -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)

This comment has been minimized.

@gvanrossum

gvanrossum Jan 18, 2018

Member

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

@elliott-beach

This comment has been minimized.

Contributor

elliott-beach commented Jan 18, 2018

@gvanrossum

This comment has been minimized.

Member

gvanrossum commented Jan 19, 2018

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

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

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@gvanrossum

This comment has been minimized.

Member

gvanrossum commented Jan 20, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment