Skip to content

Commit 5350422

Browse files
committed
ruff_annotate_snippets: update snapshot for single ASCII whitespace source
The change to the rendering code is elaborated on in more detail here, where I attempted to upstream it: rust-lang/annotate-snippets-rs#169 Otherwise, the snapshot diff also shows a bug fix: a `^` is now rendered where as it previously was not.
1 parent 1d7f07d commit 5350422

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

crates/ruff_annotate_snippets/src/renderer/display_list.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,9 +1394,7 @@ fn format_body(
13941394
}
13951395
})
13961396
.sum();
1397-
if line.chars().any(|c| !c.is_whitespace()) {
1398-
whitespace_margin = min(whitespace_margin, leading_whitespace);
1399-
}
1397+
whitespace_margin = min(whitespace_margin, leading_whitespace);
14001398
max_line_len = max(max_line_len, line_length);
14011399

14021400
let line_start_index = line_range.0;

crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__w292_4.snap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
---
22
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
3-
snapshot_kind: text
43
---
54
W292_4.py:1:2: W292 [*] No newline at end of file
65
|
76
1 |
8-
| W292
7+
| ^ W292
98
|
109
= help: Add trailing newline
1110

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy