ruff/crates
Andrew Gallant 76619b96e5 [ty] Fix rendering of long lines that are indented with tabs
It turns out that `annotate-snippets` doesn't do a great job of
consistently handling tabs. The intent of the implementation is clearly
to expand tabs into 4 ASCII whitespace characters. But there are a few
places where the column computation wasn't taking this expansion into
account. In particular, the `unicode-width` crate returns `None` for a
`\t` input, and `annotate-snippets` would in turn treat this as either
zero columns or one column. Both are wrong.

In patching this, it caused one of the existing `annotate-snippets`
tests to fail. I spent a fair bit of time on it trying to fix it before
coming to the conclusion that the test itself was wrong. In particular,
the annotation ranges are 4 bytes off. However, when the range was
wrong, the buggy code was rendering the example as intended since `\t`
characters were treated as taking up zero columns of space. Now that
they are correctly computed as taking up 4 columns of space, the offsets
of the test needed to be adjusted.

Fixes #670
2025-06-26 11:12:16 -04:00
..
ruff [ty] Move venv and conda env discovery to SearchPath::from_settings (#18938) 2025-06-26 16:39:27 +02:00
ruff_annotate_snippets [ty] Fix rendering of long lines that are indented with tabs 2025-06-26 11:12:16 -04:00
ruff_benchmark [ty] Move venv and conda env discovery to SearchPath::from_settings (#18938) 2025-06-26 16:39:27 +02:00
ruff_cache
ruff_db [ty] Move venv and conda env discovery to SearchPath::from_settings (#18938) 2025-06-26 16:39:27 +02:00
ruff_dev
ruff_diagnostics
ruff_formatter
ruff_graph [ty] Move venv and conda env discovery to SearchPath::from_settings (#18938) 2025-06-26 16:39:27 +02:00
ruff_index
ruff_linter [pyflakes] Mark F504/F522/F523 autofix as unsafe if there's a call with side effect (#18839) 2025-06-26 08:48:29 +00:00
ruff_macros Apply fix availability and applicability when adding to DiagnosticGuard and remove NoqaCode::rule (#18834) 2025-06-24 10:08:36 -04:00
ruff_notebook
ruff_options_metadata
ruff_python_ast [ruff] Trigger RUF037 for empty string and byte strings (#18862) 2025-06-24 08:26:28 +02:00
ruff_python_ast_integration_tests
ruff_python_codegen Fix f-string interpolation escaping (#18882) 2025-06-25 10:04:15 +02:00
ruff_python_formatter [formatter] Fix missing blank lines before decorated classes in .pyi files (#18888) 2025-06-24 16:25:44 +02:00
ruff_python_index
ruff_python_literal
ruff_python_parser
ruff_python_semantic
ruff_python_stdlib
ruff_python_trivia
ruff_python_trivia_integration_tests
ruff_server Use file path for detecting package root (#18914) 2025-06-24 12:32:41 +00:00
ruff_source_file
ruff_text_size
ruff_wasm
ruff_workspace Apply fix availability and applicability when adding to DiagnosticGuard and remove NoqaCode::rule (#18834) 2025-06-24 10:08:36 -04:00
ty [ty] Move venv and conda env discovery to SearchPath::from_settings (#18938) 2025-06-26 16:39:27 +02:00
ty_ide [ty] Move search path resolution to Options::to_program_settings (#18937) 2025-06-25 18:00:38 +02:00
ty_project [ty] Move venv and conda env discovery to SearchPath::from_settings (#18938) 2025-06-26 16:39:27 +02:00
ty_python_semantic [ty] Move venv and conda env discovery to SearchPath::from_settings (#18938) 2025-06-26 16:39:27 +02:00
ty_server [ty] Enforce sort order of completions (#18917) 2025-06-24 11:31:08 -04:00
ty_test [ty] Move venv and conda env discovery to SearchPath::from_settings (#18938) 2025-06-26 16:39:27 +02:00
ty_vendored [ty] eliminate is_fully_static (#18799) 2025-06-24 18:02:05 -07:00
ty_wasm [ty] Move search path resolution to Options::to_program_settings (#18937) 2025-06-25 18:00:38 +02:00