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] Preserve original value format (PLR6104) #14978

Merged
merged 11 commits into from
Dec 17, 2024

Conversation

InSyncWithFoo
Copy link
Contributor

Summary

Resolves #11672.

Test Plan

cargo nextest run and cargo insta test.

Copy link
Contributor

github-actions bot commented Dec 15, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@InSyncWithFoo
Copy link
Contributor Author

The existing implementation is surprisingly complex. On top of that, it uses the generator to create the fix, but that's not strictly necessary. String slicing is much simpler and only requires an extra hardcoded if for the Expr::Named case.

@AlexWaygood AlexWaygood added the fixes Related to suggested fixes for violations label Dec 15, 2024
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Thanks. Could you revert your changes to AugmentedOperator (and, if there are any, other refactors that aren't strictly necessary for the fix). I'd prefer to keep the changes minimal to the fix or have separate PRs for refactor and fix.

@InSyncWithFoo
Copy link
Contributor Author

I'd like to believe it isn't my fault that the mdformat check failed. A simple uvx pre-commit run --all-files commit should fix it, but I won't submit a PR as I'm not interested in finding the cause.

@AlexWaygood
Copy link
Member

I'd like to believe it isn't my fault that the mdformat check failed. A simple uvx pre-commit run --all-files commit should fix it, but I won't submit a PR as I'm not interested in finding the cause.

I believe it's due to one of the mdformat plugins we use having released a new version. We don't have these pinned in our pre-commit config file; we probably should.

Two of the plugins we use cut new releases a couple of hours ago, one of them a major version bump:

@AlexWaygood
Copy link
Member

I filed #14992 to fix the pre-commit issue.

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Thanks

@MichaReiser MichaReiser merged commit c9fdb1f into astral-sh:main Dec 17, 2024
21 checks passed
@InSyncWithFoo InSyncWithFoo deleted the PLR6104 branch December 17, 2024 16:53
@dhruvmanila dhruvmanila added the bug Something isn't working label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixes Related to suggested fixes for violations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PLR6104 rewrites numbers w/o the base indicator
4 participants