ruff icon indicating copy to clipboard operation
ruff copied to clipboard

Add "severity" to check and message API

Open charliermarsh opened this issue 2 years ago • 3 comments

This is part of the LSP diagnostic API so we should implement it.

charliermarsh avatar Nov 07 '22 19:11 charliermarsh

Out of curiosity, do you plan to mark every violation that results in a error to mark as 'error' according to the LSP API? Especially for flake8, there are a few F... codes that don't strictly result in an error in your code and should be declared as a Warning, such as e.g. F401, but then there are also codes like e.g. F523 that would definitely result in an error.

jhossbach avatar Nov 07 '22 21:11 jhossbach

I think we should probably differentiate between errors and warnings, though I need to do some research on how linters typically differentiate between the two. (In ESLint, you can also declare each code to be an error, or a warning, or whatever.) Definitely open to feedback here on what a good system would look like!

charliermarsh avatar Nov 08 '22 21:11 charliermarsh

I tried finding the severity rules for flake8 in the python extension for vscode (https://github.com/microsoft/vscode-python) but I was unsuccessful. I would say that everything resulting in a error in python should be marked as "error" (obviously), everything else should be considered a warning. I am not sure when Information is useful, and hint maybe wherever a fix is possible?

Maybe you have more luck deciphering the TS code, I never had any issues with the severity flags in vscode so they might be a good inspiration.

jhossbach avatar Nov 13 '22 14:11 jhossbach

Closing in favor of #1256.

charliermarsh avatar Dec 31 '22 18:12 charliermarsh