最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ruff - Pycharm external tool multiple commands? - Stack Overflow

programmeradmin1浏览0评论

I'm using Ruff as an external tool in PyCharm, and trying to use a hotkey to run check --fix $FilePath$ to lint first and then format $FilePath$ to format, in that order.

I can run them individually but I'd like to do them both at once for my convenience. I tried to use ; between them like PowerShell but it's not working, only running the first part of the argument check --fix $FilePath$ and throw warning: Failed to lint &: The system cannot find the file specified. (os error 2). I wonder if I'm doing it incorrectly or it's just not possible at all?

I'm using Ruff as an external tool in PyCharm, and trying to use a hotkey to run check --fix $FilePath$ to lint first and then format $FilePath$ to format, in that order.

I can run them individually but I'd like to do them both at once for my convenience. I tried to use ; between them like PowerShell but it's not working, only running the first part of the argument check --fix $FilePath$ and throw warning: Failed to lint &: The system cannot find the file specified. (os error 2). I wonder if I'm doing it incorrectly or it's just not possible at all?

Share Improve this question asked Feb 1 at 2:20 FireflyFirefly 4285 silver badges21 bronze badges 2
  • I don't think it's possible to have more than one command per tool. It is possible, though, to specify a custom executable that simply calls ruff twice. Does that work for you? – InSync Commented Feb 1 at 2:46
  • @InSync I think that's ok too. Thanks for the suggestion. – Firefly Commented Feb 1 at 16:47
Add a comment  | 

1 Answer 1

Reset to default 0

It is not possible to run two commands in one tool. Instead, you can create a custom executable that runs Ruff twice with the given arguments.

发布评论

评论列表(0)

  1. 暂无评论