mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +00:00
Refactor Fix
and Edit
API (#4198)
This commit is contained in:
parent
edaf891042
commit
0801f14046
102 changed files with 529 additions and 398 deletions
|
@ -215,14 +215,10 @@ pub fn check(contents: &str, options: JsValue) -> Result<JsValue, JsValue> {
|
|||
message: message.kind.body,
|
||||
location: start_location,
|
||||
end_location,
|
||||
fix: if message.fix.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(ExpandedFix {
|
||||
message: message.kind.suggestion,
|
||||
edits: message.fix.into_edits(),
|
||||
})
|
||||
},
|
||||
fix: message.fix.map(|fix| ExpandedFix {
|
||||
message: message.kind.suggestion,
|
||||
edits: fix.into_edits(),
|
||||
}),
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue