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

Add code action to ignore current error? #993

Open
failable opened this issue Jan 13, 2025 · 5 comments
Open

Add code action to ignore current error? #993

failable opened this issue Jan 13, 2025 · 5 comments

Comments

@failable
Copy link

failable commented Jan 13, 2025

image

basedpyright's type checking is helpful, but sometime I'd just want to ignore the error for the 3rd library without manually typing # pyright: ignore[reportUnknownVariableType,reportUnknownMemberType]...

@DetachHead
Copy link
Owner

i've thought about this before, but i'm hesitant to add this because i've seen other tools do it and it seems to encourage users to just apply the code action to suppress the error without thinking about it. from what i've seen, forcing the user to write the ignore comment manually encourages them to consider whether or not that's really the best solution.

maybe we can add the functionality but with an option to turn it off

@failable
Copy link
Author

For me, most of time whenever I saw a unsolvable lint, I think carefully, then look up the code(because Zed does not show it in the popup), and type the comment.

I think most people who use baesdpyright do care about type checking as it is stricter and more accurate than pyright. So most of them will not apply the code action blindly otherwise they won’t prefer basedpyright.

@DetachHead
Copy link
Owner

I think most people who use baesdpyright do care about type checking as it is stricter and more accurate than pyright. So most of them will not apply the code action blindly otherwise they won’t prefer basedpyright.

that's a fair point. i guess my experience is with my team at work who i've forced to use basedpyright, as well as linters like ruff on the strictest settings. many of them probably would turn them all off if they had the choice lol

also worth keeping in mind that i believe the majority of basedpyright users still turn off most of the type checking and only care about language server features like autocomplete, semantic highlighting, etc.. to many people, basedpyright is just a language server and they couldn't care less about type checking. but i guess those users won't be seeing these diagnostics anyway

@KotlinIsland
Copy link
Collaborator

only include the option when type checking is set to all / recommended

@vlkorsakov
Copy link

maybe we can add the functionality but with an option to turn it off

I think it would be better if you add this option, but it should be disabled by default. Developers who really need it (who know how to write code) can read the docs and enable this feature.

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

No branches or pull requests

4 participants