Skip to content

Add semantic model flag when inside f-string replacement field#10766

Merged
dhruvmanila merged 1 commit intomainfrom
dhruv/f-string-model-flag
Apr 4, 2024
Merged

Add semantic model flag when inside f-string replacement field#10766
dhruvmanila merged 1 commit intomainfrom
dhruv/f-string-model-flag

Conversation

@dhruvmanila
Copy link
Copy Markdown
Member

Summary

This PR adds a new semantic model flag to indicate that the checker is inside an f-string replacement field. This will be used to ignore certain checks if the target version doesn't support a specific feature like PEP 701.

fixes: #10761

Test Plan

Add a test case from the raised issue.

@dhruvmanila dhruvmanila added the bug Something isn't working label Apr 4, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@dhruvmanila dhruvmanila merged commit d02b106 into main Apr 4, 2024
@dhruvmanila dhruvmanila deleted the dhruv/f-string-model-flag branch April 4, 2024 03:38
Glyphack pushed a commit to Glyphack/ruff that referenced this pull request Apr 12, 2024
…l-sh#10766)

## Summary

This PR adds a new semantic model flag to indicate that the checker is
inside an f-string replacement field. This will be used to ignore
certain checks if the target version doesn't support a specific feature
like PEP 701.

fixes: astral-sh#10761 

## Test Plan

Add a test case from the raised issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SyntaxError after bad fix in f-string from Q000 flake8 bad-quotes-inline-string

2 participants