Skip to content

Commit

Permalink
Revert JSON serializing content to null for deletions
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Apr 11, 2023
1 parent fd31a7a commit cff3d22
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/ruff/src/message/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl Serialize for ExpandedEdits<'_> {

for edit in self.edits {
let value = json!({
"content": edit.content(),
"content": edit.content().unwrap_or_default(),
"location": edit.location(),
"end_location": edit.end_location()
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ expression: content
"message": "Remove assignment to unused variable `x`",
"edits": [
{
"content": null,
"content": "",
"location": {
"row": 6,
"column": 4
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_cli/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fn test_stdin_json() -> Result<()> {
"message": "Remove unused import: `os`",
"edits": [
{{
"content": null,
"content": "",
"location": {{
"row": 1,
"column": 0
Expand Down

0 comments on commit cff3d22

Please sign in to comment.