From 9fdb1e9bc8cc7e7f17c80ceae0e12f5b9f33a571 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Wed, 8 Jan 2025 10:22:44 -0500 Subject: [PATCH] test: update snapshot with fixed annotation but carets include whitespace I separated out this snapshot update since the string of `^` including whitespace looked a little odd. I investigated this one specifically, and indeed, our span in this case is telling `annotate-snippets` to point at the whitespace. So this is `annotate-snippets` doing what it's told with a mildly sub-optimal span. For clarity, the before rendering is: skip.py:34:1: I001 [*] Import block is un-sorted or un-formatted | 32 | import sys; import os # isort:skip 33 | import sys; import os # isort:skip # isort:skip 34 | / import sys; import os | = help: Organize imports And now after is: skip.py:34:1: I001 [*] Import block is un-sorted or un-formatted | 32 | import sys; import os # isort:skip 33 | import sys; import os # isort:skip # isort:skip 34 | import sys; import os | ^^^^^^^^^^^^^^^^^^^^^^^^^ I001 | = help: Organize imports This is a clear bug fix since it adds in the `I001` annotation, even though the carets look a little funny by including the whitespace preceding `import sys; import os`. --- ..._linter__rules__isort__tests__skip.py.snap | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__skip.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__skip.py.snap index 3acb2d46e3..9befa4c450 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__skip.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__skip.py.snap @@ -1,6 +1,5 @@ --- source: crates/ruff_linter/src/rules/isort/mod.rs -snapshot_kind: text --- skip.py:20:1: I001 [*] Import block is un-sorted or un-formatted | @@ -8,9 +7,9 @@ skip.py:20:1: I001 [*] Import block is un-sorted or un-formatted 19 | import os # isort: skip 20 | / import collections 21 | | import abc -22 | | - | |_^ I001 -23 | + | |_______________^ I001 +22 | +23 | 24 | def f(): | = help: Organize imports @@ -32,9 +31,9 @@ skip.py:27:1: I001 [*] Import block is un-sorted or un-formatted 26 | import os # isort:skip 27 | / import collections 28 | | import abc -29 | | - | |_^ I001 -30 | + | |_______________^ I001 +29 | +30 | 31 | def f(): | = help: Organize imports @@ -52,9 +51,10 @@ skip.py:27:1: I001 [*] Import block is un-sorted or un-formatted skip.py:34:1: I001 [*] Import block is un-sorted or un-formatted | -32 | import sys; import os # isort:skip -33 | import sys; import os # isort:skip # isort:skip -34 | / import sys; import os +32 | import sys; import os # isort:skip +33 | import sys; import os # isort:skip # isort:skip +34 | import sys; import os + | ^^^^^^^^^^^^^^^^^^^^^^^^^ I001 | = help: Organize imports