koxudaxi / ruff-pycharm-plugin

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

Did version 0.0.36 prioritize executing lint security fixes? #491

Open gbaian10 opened 2 months ago

gbaian10 commented 2 months ago

Describe the bug When I try to add a comma to force a line break in a function, the comma seems to be removed, causing the line break to fail.

Expected behavior image

If format is prioritized, COM819 should not occur.

Environments (please complete the following information):

dhruvmanila commented 2 months ago

It's not recommended to include COM819 if you're using both the Ruff linter and formatter as they'll conflict with each other. Refer https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules for more information. I don't think this is a bug in the extension.

gbaian10 commented 2 months ago

It's not recommended to include COM819 if you're using both the Ruff linter and formatter as they'll conflict with each other. Refer https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules for more information. I don't think this is a bug in the extension.

Because this issue didn't seem to occur in the past, and using the official plugin in VSCode also produces the expected results. I wonder if it's really because version 0.0.36 runs the linter before the formatter that causes this problem?

dhruvmanila commented 2 months ago

I wonder if it's really because version 0.0.36 runs the linter before the formatter that causes this problem?

I wouldn't recommend to rely on the order of running the linter / formatter. At least in the VS Code extension it's not in our control as it's the client (VS Code) that sends the request to the server to update the diagnostics or format the open file.