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

How to suppress "XXX is not accessed" #39

Closed
byulparan opened this issue Mar 3, 2021 · 5 comments
Closed

How to suppress "XXX is not accessed" #39

byulparan opened this issue Mar 3, 2021 · 5 comments

Comments

@byulparan
Copy link

스크린샷 2021-03-03 오후 9 24 44

I created pyrightconfig.json

{
    "reportUnusedVariable" : "none",
    "reportUnusedImport": "none",
    "reportUnusedFunction": "none",
}

but It's not effective.

when I run pyright in Terminal, It's avoid.
스크린샷 2021-03-03 오후 9 30 40

How to I get just warning / error report. I don't want get Info-level report(green face).

@tshu-w
Copy link

tshu-w commented Jun 10, 2021

@byulparan The default of "reportUnusedVariable" is "none", see here. maybe related: microsoft/pyright#1118

@tshu-w
Copy link

tshu-w commented Jun 10, 2021

@seagle0128 or maybe we can add an option to disable hint.

@byulparan
Copy link
Author

It seems not lsp-pyright problem. I resolved it via lsp-diagnostic-filter.
Thanks.

@tshu-w
Copy link

tshu-w commented Jul 19, 2021

@byulparan can you share how to set lsp-diagnostic-filter, thx

@byulparan
Copy link
Author

It just cut tag(unnecessary/deprecated) diagnostic.

(setf lsp-diagnostic-filter (lambda (param work)
			      (puthash "diagnostics" 
				       (cl-remove-if (lambda (diag) (gethash "tags" diag))
						     (gethash "diagnostics" param))
				       param)
			      param))

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

2 participants