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

Clippy lints not working #112

Closed
AndreaOrru opened this issue May 22, 2020 · 9 comments
Closed

Clippy lints not working #112

AndreaOrru opened this issue May 22, 2020 · 9 comments
Labels

Comments

@AndreaOrru
Copy link

AndreaOrru commented May 22, 2020

Clippy lints are not working for me because of:
rust-lang/rust-clippy#2604

This is fixed by:
rust-lang/rust-clippy#5363
But only when specifying -Z unstable-options with cargo clippy.

At the moment I'm just redefining the flycheck checker rustic-clippy, setting the command to:

(flycheck-define-checker rustic-clippy
  :command ("cargo" "clippy" "-Zunstable-options" "--message-format=json")
...
...
@brotzeit
Copy link
Owner

Thanks for the bug report! I will make the clippy command a defcustom and add the unstable option parameter to the default value.

@brotzeit
Copy link
Owner

And you should consider using a lsp based checker if you are using eglot or lsp-mode.

@AndreaOrru
Copy link
Author

And you should consider using a lsp based checker if you are using eglot or lsp-mode.

How can I do that?

@brotzeit
Copy link
Owner

Are you using eglot or lsp-mode ?

@AndreaOrru
Copy link
Author

Are you using eglot or lsp-mode ?

LSP mode.

@brotzeit
Copy link
Owner

I guess you are using rust-analyzer, so it should be enough to change lsp-rust-analyzer-cargo-watch-command to clippy. And remove the rustic checker from flycheck-checkers so you can see if it works with lsp.

@AndreaOrru
Copy link
Author

Great! Maybe that should documented on the README?

@AndreaOrru
Copy link
Author

AndreaOrru commented May 22, 2020

By the way, it works with clippy, but it doesn't seem to be showing rustc errors.
Nevermind, that's a separate issue. My bad :)

@brotzeit
Copy link
Owner

If you got any issues with the lsp checker please open an issue at lsp-mode.

I added a note about the lsp checker in the readme, but I wasn't able to use a defcustom as argument for the checker command. The macro doesn't seem to be able to work with values that come from a variable or you simply have to do it differently, but I couldn't find any checker that uses a variable for the command.

Since most users use the lsp based checker, I simply added -Z unstable-options to the command as you did.

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

No branches or pull requests

2 participants