-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Removing trailing whitespace inside multiline strings is unsafe #9744
Removing trailing whitespace inside multiline strings is unsafe #9744
Conversation
crates/ruff_linter/src/rules/pycodestyle/rules/trailing_whitespace.rs
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,2 @@ | |||
'''trailing whitespace | |||
inside a multiline string''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind adding a test for a multi-line f-string here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a test and it failed! From a brief look, it didn't seem trivial, and I would prefer to do this as a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
W291 | 20 | 0 | 0 | 0 | 20 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+0 -0 violations, +0 -20 fixes in 2 projects; 41 projects unchanged)
latchbio/latch (+0 -0 violations, +0 -8 fixes)
ruff check --no-cache --exit-zero --preview
+ latch/resources/map_tasks.py:2:60: W291 Trailing whitespace - latch/resources/map_tasks.py:2:60: W291 [*] Trailing whitespace + latch/resources/map_tasks.py:3:61: W291 Trailing whitespace - latch/resources/map_tasks.py:3:61: W291 [*] Trailing whitespace + latch/resources/map_tasks.py:4:60: W291 Trailing whitespace - latch/resources/map_tasks.py:4:60: W291 [*] Trailing whitespace + latch/resources/map_tasks.py:5:58: W291 Trailing whitespace - latch/resources/map_tasks.py:5:58: W291 [*] Trailing whitespace
reflex-dev/reflex (+0 -0 violations, +0 -12 fixes)
ruff check --no-cache --exit-zero --preview
+ reflex/.templates/apps/demo/code/pages/datatable.py:204:140: W291 Trailing whitespace - reflex/.templates/apps/demo/code/pages/datatable.py:204:140: W291 [*] Trailing whitespace + reflex/.templates/apps/demo/code/pages/datatable.py:205:156: W291 Trailing whitespace - reflex/.templates/apps/demo/code/pages/datatable.py:205:156: W291 [*] Trailing whitespace + reflex/.templates/apps/demo/code/pages/datatable.py:206:128: W291 Trailing whitespace - reflex/.templates/apps/demo/code/pages/datatable.py:206:128: W291 [*] Trailing whitespace + reflex/.templates/apps/demo/code/pages/datatable.py:207:100: W291 Trailing whitespace - reflex/.templates/apps/demo/code/pages/datatable.py:207:100: W291 [*] Trailing whitespace + reflex/.templates/apps/demo/code/pages/forms.py:21:32: W291 Trailing whitespace - reflex/.templates/apps/demo/code/pages/forms.py:21:32: W291 [*] Trailing whitespace + reflex/.templates/apps/demo/code/pages/forms.py:22:39: W291 Trailing whitespace - reflex/.templates/apps/demo/code/pages/forms.py:22:39: W291 [*] Trailing whitespace
Changes by rule (1 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
W291 | 20 | 0 | 0 | 0 | 20 |
Formatter (stable)
ℹ️ ecosystem check encountered format errors. (no format changes; 1 project error)
openai/openai-cookbook (error)
warning: Detected debug build without --no-cache.
error: Failed to parse examples/dalle/Image_generations_edits_and_variations_with_DALL-E.ipynb:3:7:8: Unexpected token 'prompt'
Formatter (preview)
ℹ️ ecosystem check encountered format errors. (no format changes; 1 project error)
openai/openai-cookbook (error)
ruff format --preview
warning: Detected debug build without --no-cache.
error: Failed to parse examples/dalle/Image_generations_edits_and_variations_with_DALL-E.ipynb:3:7:8: Unexpected token 'prompt'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fix #8037.