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

Inconsistent treatment of trailing whitespace in multiline strings #3822

Closed
daveware-nv opened this issue Sep 8, 2020 · 1 comment · Fixed by #7342
Closed

Inconsistent treatment of trailing whitespace in multiline strings #3822

daveware-nv opened this issue Sep 8, 2020 · 1 comment · Fixed by #7342
Assignees
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation

Comments

@daveware-nv
Copy link

Steps to reproduce

def example(*args):
    print(*args)


example(
    "bob", """
    foobar 
    more text
""",
)

example(
    "bob",
    """
    foobar2 
    more text
""",
)

Current behavior

pylint incorrectly warns about the trailing whitespace on the line with foobar2 and correctly ignores the trailing whitespace on the line with foobar.

Expected behavior

pylint should produce no trailing whitespace warnings, as all the occurrences are in literal strings.

pylint --version output

pylint 2.6.0
astroid 2.4.2
Python 3.7.8 (default, Jul 30 2020, 09:48:41)
[GCC 9.3.0]

@Pierre-Sassoulas Pierre-Sassoulas added False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Bug 🪲 labels Jun 30, 2022
@Pierre-Sassoulas
Copy link
Member

I can reproduce, this is very surprising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants