From 09274307e82e0396eb094eb17f7a0df9d642839d Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 13 Apr 2023 19:12:00 -0400 Subject: [PATCH] Add multi-edit change to BREAKING_CHANGES.md (#3968) --- BREAKING_CHANGES.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index a6d5872544..2e269c1f17 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -1,5 +1,40 @@ # Breaking Changes +## 0.0.260 + +### Fixes are now represented as a list of edits ([#3709](https://github.com/charliermarsh/ruff/pull/3709)) + +Previously, Ruff represented each fix as a single edit, which prohibited Ruff from automatically +fixing violations that required multiple edits across a file. As such, Ruff now represents each +fix as a list of edits. + +This primarily affects the JSON API. Ruff's JSON representation used to represent the `fix` field as +a single edit, like so: + +```json +{ + "message": "Remove unused import: `sys`", + "content": "", + "location": {"row": 1, "column": 0}, + "end_location": {"row": 2, "column": 0} +} +``` + +The updated representation instead includes a list of edits: + +```json +{ + "message": "Remove unused import: `sys`", + "edits": [ + { + "content": "", + "location": {"row": 1, "column": 0}, + "end_location": {"row": 2, "column": 0}, + } + ] +} +``` + ## 0.0.246 ### `multiple-statements-on-one-line-def` (`E704`) was removed ([#2773](https://github.com/charliermarsh/ruff/pull/2773))