Switch db to ruff_annotate_snippets' suggestions - #27576
Conversation
| --> input.py:1:1 | ||
| | | ||
| - | ||
| 1 | from test import say_hy | ||
| | | ||
| --> input.py:1:1 | ||
| | | ||
| 1 | from test import say_hy | ||
| 2 | | ||
| 3 | if __name__ == "__main__": | ||
| 4 | say_hy("dear Ruff contributor") | ||
| | |
There was a problem hiding this comment.
Example of one of the bugs I need to work through
| | | ||
| - import os # F401 | ||
| 1 | x = y # F821 | ||
| 1 - import os # F401 |
There was a problem hiding this comment.
Rendering difference: removed lines still count towards the line numbers
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 96.96%. The percentage of expected errors that received a diagnostic held steady at 92.96%. The number of fully passing files held steady at 106/133. |
| --> bar.py:1:7 | ||
| | | ||
| - bar = "needs formatting" | ||
| 1 + bar = "needs formatting" | ||
| | | ||
| --> bar.py:1:7 | ||
| | | ||
| 1 | bar = "needs formatting" | ||
| | ~~~~~~~~~~~~~~~~~~ | ||
|
|
There was a problem hiding this comment.
~ is the symbol for "added and removed". In unicode, it uses ±. I could hack that in our "ascii" renderer since it is already a hybrid unicode/ascii renderer until we get proper unicode support
There was a problem hiding this comment.
However, I think in this particular use of ± is a mistake. annotate-snippets assumes that suggestions are in context of an existing snippet. When making formatting changes like this, the suggestion is the annotation and i should never be rendered with ±, only + or full diffs.
Memory usage reportMemory usage unchanged ✅ |
| ::: cell 3:0:1 | ||
| | | ||
| - import sys | ||
| 0 - import sys |
There was a problem hiding this comment.
Rendering difference: we are showing the full location for cells. This was trying to compromise between our current output and annotate snippets
|
| --> -:1:1 | ||
| --> -:1:1 | ||
| | | ||
| 1 + # fix from stable-test-rule-safe-fix | ||
| | |
There was a problem hiding this comment.
Apparently we have an alignment bug
| 6 | line 6 | ||
| - line 7 | ||
| 7 + fixed line 7 | ||
| 8 | line 8 | ||
| | | ||
| 7 | fixed line 7 | ||
| | +++++ | ||
| note: This is an unsafe fix and may change runtime behavior |
There was a problem hiding this comment.
This is showing a pure-insertion happened, rather than having to fallback to a full diff
| 2 ~ fixed line 2 | ||
| 3 | line 3 | ||
| … | ||
| 6 | line 6 | ||
| 7 ~ fixed line 7 | ||
| 8 | line 8 | ||
| … | ||
| 12 | line 12 | ||
| - line 13 | ||
| 13 + fixed line 13 | ||
| 13 ~ fixed line 13 |
There was a problem hiding this comment.
Annotate-snippets doesn't recognize a pure-insertions when there are multiple patches being applied. I figured this is fine because this is a bit of a contrived test case.
|
Summary
Motivations
Origin, and remove one more patch on top of upstreamTest Plan