mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:43 +00:00
Rename applicability levels to Safe
, Unsafe
, and Display
(#7843)
After working with the previous change in https://github.com/astral-sh/ruff/pull/7821 I found the names a bit unclear and their relationship with the user-facing API muddied. Since the applicability is exposed to the user directly in our JSON output, I think it's important that these names align with our configuration options. I've replaced `Manual` or `Never` with `Display` which captures our intent for these fixes (only for display). Here, we create room for future levels, such as `HasPlaceholders`, which wouldn't fit into the `Always`/`Sometimes`/`Never` levels. Unlike https://github.com/astral-sh/ruff/pull/7819, this retains the flat enum structure which is easier to work with.
This commit is contained in:
parent
4b537d1297
commit
0fc76ba276
188 changed files with 343 additions and 371 deletions
|
@ -178,9 +178,10 @@ def fibonacci(n):
|
|||
},
|
||||
TextRange::new(TextSize::from(7), TextSize::from(9)),
|
||||
)
|
||||
.with_fix(Fix::sometimes_applies(Edit::range_deletion(
|
||||
TextRange::new(TextSize::from(0), TextSize::from(10)),
|
||||
)));
|
||||
.with_fix(Fix::unsafe_edit(Edit::range_deletion(TextRange::new(
|
||||
TextSize::from(0),
|
||||
TextSize::from(10),
|
||||
))));
|
||||
|
||||
let fib_source = SourceFileBuilder::new("fib.py", fib).finish();
|
||||
|
||||
|
@ -192,7 +193,7 @@ def fibonacci(n):
|
|||
},
|
||||
TextRange::new(TextSize::from(94), TextSize::from(95)),
|
||||
)
|
||||
.with_fix(Fix::sometimes_applies(Edit::deletion(
|
||||
.with_fix(Fix::unsafe_edit(Edit::deletion(
|
||||
TextSize::from(94),
|
||||
TextSize::from(99),
|
||||
)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue