-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Only render hyperlinks for terminals known to support them #21519
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1883e01
Only reneder hyperlinks for terminals known to support them
MichaReiser 06bafe2
Move notebook tests because of trailing whitespace
MichaReiser 4de8d70
Random rule change
MichaReiser db186ae
Discard changes to crates/ty_python_semantic/src/suppression.rs
MichaReiser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...render/snapshots/ruff_db__diagnostic__render__full__tests__notebook_output_with_diff.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| --- | ||
| source: crates/ruff_db/src/diagnostic/render/full.rs | ||
| expression: env.render_diagnostics(&diagnostics) | ||
| --- | ||
| error[unused-import][*]: `os` imported but unused | ||
| --> notebook.ipynb:cell 1:2:8 | ||
| | | ||
| 1 | # cell 1 | ||
| 2 | import os | ||
| | ^^ | ||
| | | ||
| help: Remove unused import: `os` | ||
| ::: cell 1 | ||
| 1 | # cell 1 | ||
| - import os | ||
|
|
||
| error[unused-import][*]: `math` imported but unused | ||
| --> notebook.ipynb:cell 2:2:8 | ||
| | | ||
| 1 | # cell 2 | ||
| 2 | import math | ||
| | ^^^^ | ||
| 3 | | ||
| 4 | print('hello world') | ||
| | | ||
| help: Remove unused import: `math` | ||
| ::: cell 2 | ||
| 1 | # cell 2 | ||
| - import math | ||
| 2 | | ||
| 3 | print('hello world') | ||
|
|
||
| error[unused-variable][*]: Local variable `x` is assigned to but never used | ||
| --> notebook.ipynb:cell 3:4:5 | ||
| | | ||
| 2 | def foo(): | ||
| 3 | print() | ||
| 4 | x = 1 | ||
| | ^ | ||
| | | ||
| help: Remove assignment to unused variable `x` | ||
| ::: cell 3 | ||
| 1 | # cell 3 | ||
| 2 | def foo(): | ||
| 3 | print() | ||
| - x = 1 | ||
| 4 | | ||
| note: This is an unsafe fix and may change runtime behavior |
27 changes: 27 additions & 0 deletions
27
...s/ruff_db__diagnostic__render__full__tests__notebook_output_with_diff_spanning_cells.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| source: crates/ruff_db/src/diagnostic/render/full.rs | ||
| expression: env.render(&diagnostic) | ||
| --- | ||
| error[unused-import][*]: `os` imported but unused | ||
| --> notebook.ipynb:cell 1:2:8 | ||
| | | ||
| 1 | # cell 1 | ||
| 2 | import os | ||
| | ^^ | ||
| | | ||
| help: Remove unused import: `os` | ||
| ::: cell 1 | ||
| 1 | # cell 1 | ||
| - import os | ||
| ::: cell 2 | ||
| 1 | # cell 2 | ||
| - import math | ||
| 2 | | ||
| 3 | print('hello world') | ||
| ::: cell 3 | ||
| 1 | # cell 3 | ||
| 2 | def foo(): | ||
| 3 | print() | ||
| - x = 1 | ||
| 4 | | ||
| note: This is an unsafe fix and may change runtime behavior |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 made those tests "normal" snapshot tests because some snapshot lines contain trailing whitespace that Zed strips (might be a bug in Zed as I don't think an editor should strip trailing whitespace in a string!).
I spent some time yesterday trying to fix the trailing whitespace but without success.
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.
Yeah I support this. My editor (nvim) is configured to do the same.