koxudaxi / ruff-pycharm-plugin

PyCharm plugin for ruff. This plugin provides reformat code using ruff.
MIT License
184 stars 7 forks source link

Exception during #329

Closed grundew closed 3 months ago

grundew commented 7 months ago

ruff is configured to:

I get the following exception: The following command was executed:

C:\Users\gw\venv311\Scripts\ruff.exe format --force-exclude --quiet -

The exit code: 2 The error output of the command:

Error Running Ruff at com.koxudaxi.ruff.RuffKt.runCommand(Ruff.kt:251) at com.koxudaxi.ruff.RuffKt.runCommand(Ruff.kt:190) at com.koxudaxi.ruff.RuffKt.runRuff(Ruff.kt:329) at com.koxudaxi.ruff.RuffApplyService.apply$lambda$2(RuffApplyService.kt:66) at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:249) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:840)

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Environments

Additional context Add any other context about the problem here.

EternityMar22 commented 7 months ago

I met the same problem.

AntoineD commented 7 months ago

Same too.

johnthagen commented 7 months ago

I hit this when switching Projects sometimes.

macOS PyCharm Professional 20233.3.1.

koxudaxi commented 7 months ago

@grundew @1669026686 @AntoineD @johnthagen I'm sorry for my late response Thank you for posting the issue. I will fix it.

gSchurkus commented 6 months ago

I believe to see the same or at least a related issue. I'll add some details here in the hope this helps.

Failure Details

plugin crashes at IDE start with

Exception in plugin Ruff (0.0.19).

Details include

ExternalToolPass: 

com.intellij.diagnostic.PluginException: annotator: com.koxudaxi.ruff.RuffExternalAnnotator@63039037 (class com.koxudaxi.ruff.RuffExternalAnnotator) [Plugin: com.koxudaxi.ruff]
    at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
    at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:89)
        ...
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: The following command was executed:

/home/user/.virtualenvs/myenv/bin/ruff --config /home/user/mysrc/pyproject.toml --exit-zero --no-cache --force-exclude --no-fix --format json --stdin-filename path/to/file.py -

The exit code: 2
The error output of the command:

error: unexpected argument '--format' found

  tip: to pass '--format' as a value, use '-- --format'

Version Info

IDE: IntelliJIdea 2023.1 OS: Linux Ruff version: 0.1.11 Plugin Version: 0.0.19 (most recent in plugin store)


@koxudaxi Thank you for looking into it!

koxudaxi commented 3 months ago

I hope the problem has been resolved in v0.0.32 If you will meet the problem, then please leave a comment. https://github.com/koxudaxi/ruff-pycharm-plugin/pull/409