Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ignoring warnings on an ad hoc basis #453

Closed
jean opened this issue Apr 28, 2021 · 8 comments
Closed

Enable ignoring warnings on an ad hoc basis #453

jean opened this issue Apr 28, 2021 · 8 comments
Assignees

Comments

@jean
Copy link

jean commented Apr 28, 2021

What's the output of :CocCommand pyright.version

[coc.nvim] coc-pyright 1.1.135 with Pyright 1.1.135

PyRight emits warnings for e.g. unused names (microsoft/pyright#1118).
Nvim with CoC displays this quite obtrusively. With PyLint, it's possible to silence warnings on individual lines using comments like # pylint: disable=W0612.

Is anything similar possible for PyRight?

@fannheyward
Copy link
Owner

Put # type: ignore in the end of the line.

@jean
Copy link
Author

jean commented Apr 30, 2021

Hmm maybe something else is missing on my side ..
Screenshot from 2021-04-30 10-18-57

@yaegassy
Copy link
Contributor

@jean Please check here and give it a try. #271 (comment)

@jean
Copy link
Author

jean commented May 6, 2021

@yaegassy thanks for the pointer. It's good, but it's global. I would like to normally see this type of hint, and to be able to turn it off on a case-by-case basis.

@yaegassy
Copy link
Contributor

yaegassy commented May 6, 2021

@jean It is also possible to change the settings at the "project level". :CocLocalConfig

I had previously considered adding a feature that would completely suppress the hint messages themselves, but for various reasons, this feature has been removed. #428 (comment)

@jean
Copy link
Author

jean commented May 6, 2021

@yaegassy project level is better already, but this is really the kind of thing that's relevant on a case by case basis. It looks like #428 (comment) is about a global category of parameters that should not be flagged.
In my case, it's about warnings that would normally be helpful and desired, e.g. in this case about a variable that's unused but present due to the shape of the data being iterated, that I'd like to silence explicitly after due consideration, so that others who look at the code (including future me) know what we're up to.

@yaegassy
Copy link
Contributor

yaegassy commented May 6, 2021

@jean OK, I understand what you want to do. But unfortunately, there is no way to suppress this hint message individually at the moment.

@ssgosh
Copy link

ssgosh commented Feb 24, 2023

Does something like this work: https://stackoverflow.com/a/72322304/2109112 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants