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

Add argument to skip formatting in f-string with double-string-fixer #1045

Closed
SachiaLanlus opened this issue Apr 22, 2024 · 6 comments
Closed

Comments

@SachiaLanlus
Copy link

Thank you for this great project. It saves me so much time for chore stuff.
However there is a thing about double-string-fixer annoying me these days.
My team's dev env is set to be Python 3.8.
But my dev env is Python 3.12 for some script to run.
But if I trigger a pre-commit. It will change the quote sign in nested f-string for me.
Which is not allowed in the Python 3.8.
Is there any method to skip this check inside f-string or to specify python-version in argument?

I think this issue is related to #971 and #973

@asottile
Copy link
Member

you're using an outdated version

@SachiaLanlus
Copy link
Author

SachiaLanlus commented Apr 22, 2024

you're using an outdated version

I don't think so.
I mean the target env is Python 3.8. So the quote sign in f-string should not be the same as the outer.
But the env which I execute pre-commit is Python 3.12.
The only way to let it respect Python 3.8 standard is to set the default_language_version.
I just wonder if there is a argument or flag to indicate the target version of this single rule.

@asottile
Copy link
Member

show your configuration then

@SachiaLanlus
Copy link
Author

show your configuration then

I will paste the config when I back to work tmr.

@SachiaLanlus
Copy link
Author

looks like you are right.
update to the latest version fix the issue.
thank you

@asottile
Copy link
Member

try that before reporting an issue next time

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

No branches or pull requests

2 participants