koxudaxi / ruff-pycharm-plugin

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

Many rule violations do not appear in inspections #299

Closed gmyers18 closed 5 months ago

gmyers18 commented 10 months ago

For a simple ruff.toml config and a trivial Python script, a number of rule violations that are indicated by ruff check do not appear as inspections results in PyCharm.

Config / Code

ruff.toml

select = ["ALL"]
ignore = ["ANN", "D", "EM"]

[lint]
preview = true

foo.py (screenshot to show line numbers, raw source code is attached) image

Results

As shown below ruff check reports 12 errors, whereas the plugin only reports 4 (plus some other issues raised by builtin PyCharm inspections). The rules missed by the plugin are: CPY001, TD002, TD003, FIX002, W293, COM812, W292. This is a bare-bones example and I don't expect that this is a comprehensive list of rules that do not appear in the inspection results.

I've tried a number of configurations tweaks, but none have made a difference. Also, I can't seem to discern any sort of pattern as far as which rules show up in the inspections, and which do not.

ruff check image

Plugin image

Environment

ruff.toml.txt foo.py.txt bar.py.txt

koxudaxi commented 10 months ago

Thank you for creating the issue. It's interesting. the inspection feature might not get some of the results of ruff warning 🤔 I will check it.