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 false negative for bad-string-format-type when using a variable as input #6194

Merged
merged 4 commits into from
Apr 5, 2022

Conversation

DudeNr33
Copy link
Collaborator

@DudeNr33 DudeNr33 commented Apr 5, 2022

  • 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.
  • If you used multiple emails or multiple names when contributing, add your mails
    and preferred name in script/.contributors_aliases.json

Type of Changes

Type
🐛 Bug fix
✨ New feature
🔨 Refactoring
📜 Docs

Description

First and easy part of #6163.

After I started to work on this I realized that making bad-string-format-type and bad-format-character work on new-style formatting and f-strings will require a change to pylint.checkers.utils.parse_format_method_string.
As this also leads to small adjustments in the callers of this function, I would rather do this in a separate PR, and then continue working on bas-string-format-type and bad-format-character.

@DudeNr33 DudeNr33 added Bug 🪲 False Negative 🦋 No message is emitted but something is wrong with the code labels Apr 5, 2022
@DudeNr33 DudeNr33 added this to the 2.14.0 milestone Apr 5, 2022
@@ -244,7 +244,6 @@ class StringFormatChecker(BaseChecker):
"format-needs-mapping",
"too-many-format-args",
"too-few-format-args",
"bad-string-format-type",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To make up for the times a message is forgotten in check_messages we had bad-string-format-type twice here. 😀

@coveralls
Copy link

coveralls commented Apr 5, 2022

Pull Request Test Coverage Report for Build 2097408196

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

Totals Coverage Status
Change from base Build 2096791472: 0.003%
Covered Lines: 15712
Relevant Lines: 16622

💛 - Coveralls

@DudeNr33 DudeNr33 merged commit 56213d9 into pylint-dev:main Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 False Negative 🦋 No message is emitted but something is wrong with the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants