Add noqa_row to diagnostics JSON format (#3228)

In ruff-lsp (https://github.com/charliermarsh/ruff-lsp/pull/76) we want to add a "Disable \<rule\> for this line" quickfix. However, finding the correct line into which the `noqa` comment should be inserted is non-trivial (multi-line strings for example).

Ruff already has this info, so expose it in the JSON output for use by ruff-lsp.
This commit is contained in:
Ran Benita 2023-02-26 01:13:16 +02:00 committed by GitHub
parent cd9fbeb560
commit 33c31cda27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 3 deletions

View file

@ -112,7 +112,8 @@ fn test_stdin_json() -> Result<()> {
"row": 1,
"column": 10
}},
"filename": "{file_path}"
"filename": "{file_path}",
"noqa_row": 1
}}
]
"#