Skip to content

Fix column index of FIXME warnings #4246

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 10 commits into from
Mar 25, 2021
Merged

Conversation

ksaketou
Copy link
Contributor

Steps

  • Add yourself to CONTRIBUTORS if you are a new contributor.
  • Add a ChangeLog entry describing what your PR does.
  • If it's a new feature or an important bug fix, add a What's New entry in doc/whatsnew/<current release.rst>.
  • Write a good description on what the PR does.

Description

The column index value at the miscellaneous checker was changed. The grouping of the match variable was affecting the column index used each time (variable note), so the note variable was removed to fix that. Also, the expected column indexes of the functional test of FIXME warnings were changed.

Type of Changes

Type
🐛 Bug fix

Related Issue

Closes #4218

@Pierre-Sassoulas Pierre-Sassoulas added the Enhancement ✨ Improvement to a component label Mar 21, 2021
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

Great first change, the code is now correct and simpler ! I see there is another functional test to update (you can launch all tests locally with python3 -m pytest), and I made a minor comment, but this is going to be in 2.7.3 :) Now that I think of it you can also add your change in the changelog if you want.

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.7.3 milestone Mar 21, 2021
@coveralls
Copy link

coveralls commented Mar 23, 2021

Coverage Status

Coverage increased (+0.0007%) to 91.434% when pulling 05fce4f on ksaketou:master into cdfc837 on PyCQA:master.

@ksaketou
Copy link
Contributor Author

Thank you for the feedback! I added those changes, please let me know what you think.

self.add_message(
"fixme",
col_offset=comment.string.lower().index(note.lower()),
col_offset=comment.start[1] + 1,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you notice here, comment.start[1] + 1 is the starting column of the user's comment. I think tabulation's spaces have been automatically counted during tokenization, so number of spaces won't always be a fixed number.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

The tests are passing now, I think this is great and we can merge 😄 . Is there something you want to change @ksaketou ?

@ksaketou
Copy link
Contributor Author

Great! I don't have any more changes, I think the column will be fixed now :)

@Pierre-Sassoulas Pierre-Sassoulas merged commit ea1fcd6 into pylint-dev:master Mar 25, 2021
@Pierre-Sassoulas
Copy link
Member

Thank you for the merge request and congratulation on becoming a pylint contributor ! 🎉

Pierre-Sassoulas added a commit that referenced this pull request Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect horizontal position of fixme warnings (W0511)
3 participants