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 disabling of fixme #7144

Merged
merged 6 commits into from Jul 7, 2022
Merged

Fix disabling of fixme #7144

merged 6 commits into from Jul 7, 2022

Conversation

DanielNoord
Copy link
Collaborator

  • 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.

Type of Changes

Type
🐛 Bug fix

Description

@DanielNoord DanielNoord added Bug 🪲 Needs backport Needs to be cherry-picked on the current patch version by a pylint's maintainer C: Pragma's labels Jul 7, 2022
@DanielNoord DanielNoord added this to the 2.14.5 milestone Jul 7, 2022
@coveralls
Copy link

coveralls commented Jul 7, 2022

Pull Request Test Coverage Report for Build 2631234011

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 95.384%

Totals Coverage Status
Change from base Build 2628357887: 0.02%
Covered Lines: 16695
Relevant Lines: 17503

💛 - Coveralls

@github-actions

This comment has been minimized.

comment_text = comment.string[1:].lstrip() # trim '#' and white-spaces

# handle pylint disable clauses
disable_option_match = OPTION_PO.search(comment_text)
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand what this code is doing well. We were ignoring fixme if there was something looking like a pylint disable comment ? 😕

i.e. pylint: disable=fixme TODO or pylint: disable=no-member TODO should not raise ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, we were seeing if there is a # pylint: disable=fixme on the same line as the fixme comment. However, we have other code that does this for us and it doesn't allow using disable-next.
Just removing is fine.

Copy link
Member

Choose a reason for hiding this comment

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

I don't see the part where it's specific to "fixme" though, wasn't it a special case where you could add TODO in pylint disable ? (Someone too lazy to do a grep for "pylint: disable" at some point, but not lazy enough to not add TODO everywhere ?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think it actually does anything other than disallow disable. PragmaParserError probably catches all other issues.

The fact that all of our enable tests work without this shows that it is completely unnecessary 😄

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for asking but this cleanup looked too good to be true 😄 I'm just amazed at the number of time we just remove a bunch of code to fix a bug. It's been happening over and over.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

😄

I also was quite surprised when I found this code. At first I though for some reason the fixme checker was responsible for parsing all pragma's but then I remembered that I actually refactored that code myself and made sure that it will always be PyLinter ... 😅

Copy link
Member

Choose a reason for hiding this comment

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

Having refactored half the codebase has its perks 😄

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
@@ -1 +0,0 @@
You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !
Copy link
Member

Choose a reason for hiding this comment

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

It's to get crafty with regex to force the presence of a ticket number, for example see #2874 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

I'm suggesting to add that text in detail.rst, but it's impossible to suggest on remove file :)

(My pylint dev machine just died, I lost a lot of unpushed branch :( )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh not. That sounds bad... Might be able to recover some from your fork?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah some branches I pushed semi regularly, everything experimental or unfinished though... (especially a massive invalid-name refactor for name that were too small...) Well at least I won't have to clean up the git repo anymore and I get to start from a clean slate 🥲 I had a disk space problem for some time, and after months of just deleting the cache from time to time I think I finally had something important that did not get written correctly (auth app crashed) 😅

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
@github-actions

This comment has been minimized.

@DanielNoord DanielNoord merged commit 3c34ae7 into pylint-dev:main Jul 7, 2022
@DanielNoord DanielNoord deleted the fixme branch July 7, 2022 17:42
@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2022

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 31bcdd6

@Pierre-Sassoulas Pierre-Sassoulas added Backported and removed Needs backport Needs to be cherry-picked on the current patch version by a pylint's maintainer labels Jul 17, 2022
Pierre-Sassoulas added a commit to Pierre-Sassoulas/pylint that referenced this pull request Jul 17, 2022
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Pierre-Sassoulas added a commit to Pierre-Sassoulas/pylint that referenced this pull request Jul 17, 2022
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Pierre-Sassoulas added a commit that referenced this pull request Jul 17, 2022
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants