From 6db957be2a665a58ec01cd063579f66fcbe690e0 Mon Sep 17 00:00:00 2001 From: Vito De Tullio Date: Wed, 18 Oct 2023 15:04:17 +0200 Subject: [PATCH] pass `--output-format` instead of `--format` since [version 0.0.291](https://github.com/astral-sh/ruff/releases/tag/v0.0.291) ruff executable has replaced `--format` with `output-format`. And in ruff `0.1.0` the only supported parameter is the new one --- .../src/com/python/pydev/analysis/ruff/RuffAnalysis.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/ruff/RuffAnalysis.java b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/ruff/RuffAnalysis.java index 9e51067277..a77c2c8e95 100644 --- a/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/ruff/RuffAnalysis.java +++ b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/ruff/RuffAnalysis.java @@ -152,8 +152,8 @@ void createRuffProcess(IExternalCodeAnalysisStream out) String userArgs = StringUtils.replaceNewLines( RuffPreferences.getRuffArgs(resource), " "); List userArgsAsList = new ArrayList<>(Arrays.asList(ProcessUtils.parseArguments(userArgs))); - if (!userArgsAsList.contains("--format=json")) { - userArgsAsList.add("--format=json"); + if (!userArgsAsList.contains("--output-format=json")) { + userArgsAsList.add("--output-format=json"); } // run ruff in project location IProject project = resource.getProject(); @@ -272,7 +272,7 @@ public void afterRunProcess(String output, String errors, IExternalCodeAnalysisS jsonValue = JsonValue.readFrom(output); } catch (Exception e) { Log.log(StringUtils.format( - "Expected ruff output to be with json format. i.e.: --format=json.\nFile: %s\nOutput:\n%s", + "Expected ruff output to be with json format. i.e.: --output-format=json.\nFile: %s\nOutput:\n%s", resource.getFullPath(), output), e); return; } @@ -466,4 +466,4 @@ public void join() { } } } -} \ No newline at end of file +}