ruff
eed0595b - test: another set of updates related to line terminator handling

Commit
331 days ago
test: another set of updates related to line terminator handling This group of updates is similar to the last one, but they call out the fact that while the change is an improvement, it does still seem to be a little buggy. As one example, previously we would have this: | 1 | / from __future__ import annotations 2 | | 3 | | from typing import Any 4 | | 5 | | from requests import Session 6 | | 7 | | from my_first_party import my_first_party_object 8 | | 9 | | from . import my_local_folder_object 10 | | 11 | | 12 | | 13 | | class Thing(object): | |_^ I001 14 | name: str 15 | def __init__(self, name: str): | = help: Organize imports And now here's what it looks like after: | 1 | / from __future__ import annotations 2 | | 3 | | from typing import Any 4 | | 5 | | from requests import Session 6 | | 7 | | from my_first_party import my_first_party_object 8 | | 9 | | from . import my_local_folder_object 10 | | 11 | | 12 | | | |__^ Organize imports 13 | class Thing(object): 14 | name: str 15 | def __init__(self, name: str): | = help: Organize imports So at least now, the diagnostic is not pointing to a completely unrelated thing (`class Thing`), but it's still not quite pointing to the imports directly. And the `^` is a bit offset. After looking at some examples more closely, I think this is probably more of a bug with how we're generating offsets, since we are actually pointing to a location that is a few empty lines _below_ the last import. And `annotate-snippets` is rendering that part correctly. However, the offset from the left (the `^` is pointing at `r` instead of `f` or even at the end of `from . import my_local_folder_object`) appears to be a problem with `annotate-snippets` itself. We accept this under the reasoning that it's an improvement, albeit not perfect.
Author
Committer
Parents
Loading