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

[flynt] Do not offer a fix when the new string is too long (FLY002) #15706

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

InSyncWithFoo
Copy link
Contributor

Summary

Resolves #5150.

Test Plan

cargo nextest run and cargo insta test.

@InSyncWithFoo
Copy link
Contributor Author

This is just a workaround rather than a proper fix, since I'm not sure how to make the generator generate multiline, dedented strings.

Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser added the fixes Related to suggested fixes for violations label Jan 24, 2025
@MichaReiser
Copy link
Member

MichaReiser commented Jan 24, 2025

Hm I think we actually stopped the practice of not offering a fix if the resulting expression becomes too long. The only exception to this are some of the simplify rules because the expression length is considered an approximation for "simplyfing".

So I think we should simply close the issue instead and hint users towards suppressing the rule in this particular case.

But I must admit I can see some argument for respecting the line length, at least when targeting pre Python 3.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixes Related to suggested fixes for violations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ruff fails on the issue introduced during fix
2 participants