ruff/crates
Zanie Blue 100904adb9
Avoid parsing other parts of a format specification if replacements are present (#6858)
Closes #6767
Replaces https://github.com/astral-sh/ruff/pull/6773 (this cherry-picks
some parts from there)
Alternative to the approach introduced in #6616 which added support for
placeholders in format specifications while retaining parsing of other
format specification parts.

The idea is that if there are placeholders in a format specification we
will not attempt to glean semantic meaning from the other parts of the
format specification we'll just extract all of the placeholders ignoring
other characters. The dynamic content of placeholders can drastically
change the meaning of the format specification in ways unknowable by
static analysis. This change prevents false analysis and will ensure
safety if we build other rules on top of this at the cost of missing
detection of some bad specifications.

Minor note: I've use "replacements" and "placeholders" interchangeably
but am trying to go with "placeholder" as I think it's a better term for
the static analysis concept here
2023-08-25 17:42:57 +00:00
..
flake8_to_ruff Bump version to 0.0.285 (#6660) 2023-08-17 15:46:28 -05:00
ruff Avoid parsing other parts of a format specification if replacements are present (#6858) 2023-08-25 17:42:57 +00:00
ruff_benchmark Extend `BestFitting` with `mode` (#6814) 2023-08-23 17:23:45 +02:00
ruff_cache Error on zero tab width (#6429) 2023-08-08 16:51:37 -04:00
ruff_cli Rename Notebook related symbols (#6862) 2023-08-25 11:40:54 +05:30
ruff_dev Improve formatter contributor docs (#6776) 2023-08-24 10:45:08 +00:00
ruff_diagnostics Avoid attempting to fix PT018 in multi-statement lines (#6829) 2023-08-23 19:09:34 -04:00
ruff_formatter Printer: Slice based queue and stack (#6819) 2023-08-24 14:49:27 +02:00
ruff_index Add unreachable code rule (#5384) 2023-07-04 14:27:23 +00:00
ruff_macros Remove parser dependency from ruff-python-ast (#6096) 2023-07-26 17:47:22 +02:00
ruff_python_ast Rename Notebook related symbols (#6862) 2023-08-25 11:40:54 +05:30
ruff_python_codegen Make `Parameters` an optional field on `ExprLambda` (#6669) 2023-08-18 15:34:54 +00:00
ruff_python_formatter Use `BestFit` layout even for attributes with a short name (#6872) 2023-08-25 17:47:02 +02:00
ruff_python_index Avoid attempting to fix PT018 in multi-statement lines (#6829) 2023-08-23 19:09:34 -04:00
ruff_python_literal Avoid parsing other parts of a format specification if replacements are present (#6858) 2023-08-25 17:42:57 +00:00
ruff_python_parser Rename parser goal 'All' to 'all' (#6867) 2023-08-25 12:00:57 +00:00
ruff_python_resolver Replace `.map_or(false, $closure)` with `.is_some_and(closure)` (#6244) 2023-08-01 19:29:42 +02:00
ruff_python_semantic Update `mutable-argument-default` (`B006`) to use `extend-immutable-calls` when determining if annotations are immutable (#6781) 2023-08-23 15:44:35 +00:00
ruff_python_stdlib Replace `.map_or(false, $closure)` with `.is_some_and(closure)` (#6244) 2023-08-01 19:29:42 +02:00
ruff_python_trivia Format all attribute dot comments manually (#6825) 2023-08-25 03:50:56 +00:00
ruff_shrinking Implement `Ranged` on more structs (#6639) 2023-08-17 11:22:39 -04:00
ruff_source_file Skip BOM when determining Locator's line starts (#6159) 2023-07-29 11:47:13 +00:00
ruff_text_size Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_wasm Set a default on `PythonVersion` (#6446) 2023-08-09 15:19:27 +00:00