Skip to content

[pylint] Preserve original value format (PLR6104)#14978

Merged
MichaReiser merged 11 commits intoastral-sh:mainfrom
InSyncWithFoo:PLR6104
Dec 17, 2024
Merged

[pylint] Preserve original value format (PLR6104)#14978
MichaReiser merged 11 commits intoastral-sh:mainfrom
InSyncWithFoo:PLR6104

Conversation

@InSyncWithFoo
Copy link
Contributor

Summary

Resolves #11672.

Test Plan

cargo nextest run and cargo insta test.

@github-actions
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.

InSyncWithFoo and others added 2 commits December 15, 2024 19:50
…ment.rs

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
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

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