Skip to content

Commit 421aa49

Browse files
committed
Fix missing --no-fix.
If `fix=true` is set in the `pyproject.toml` file, ruff will return the file instead of diagnostics. Adding `--no-fix` avoids this.
1 parent 69dd6a3 commit 421aa49

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

pylsp_ruff/ruff_lint.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ def build_args(document: Document, options: dict) -> list:
187187
args = ["--quiet"]
188188
# Use the json formatting for easier evaluation
189189
args.extend(["--format=json"])
190+
# Do not attempt to fix -> returns file instead of diagnostics
191+
args.extend(["--no-fix"])
190192

191193
# Convert per-file-ignores dict to right format
192194
per_file_ignores = options.pop("per-file-ignores")

tests/test_ruff_lint.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def test_ruff_multiline(workspace):
148148
"ruff",
149149
"--quiet",
150150
"--format=json",
151+
"--no-fix",
151152
"--exclude=blah,file_2.py",
152153
"--",
153154
"-",

0 commit comments

Comments
 (0)