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

[pylint] Also report when the object isn't a literal (PLE1310) #15985

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

InSyncWithFoo
Copy link
Contributor

Summary

Follow-up to #15984.

Previously, PLE1310 would only report when the object is a literal:

'a'.strip('//')  # error

foo = ''
foo.strip('//')  # no error

After this change, objects whose type can be inferred to be either str or bytes will also be reported in preview.

Test Plan

cargo nextest run and cargo insta test.

Copy link
Contributor

github-actions bot commented Feb 6, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser
Copy link
Member

MichaReiser commented Feb 6, 2025

Thank you. I'll convert this to draft until #15984 is merged. It's otherwise fairly hard to review the changes and I can't change the base because you're an external contributor :(

@MichaReiser MichaReiser marked this pull request as draft February 6, 2025 08:03
@MichaReiser MichaReiser added the rule Implementing or modifying a lint rule label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants