3

rust-clippy is a linter for Rust. Is there an existing package or idiom that integrates it into an Emacs Rust workflow, the way emacs-racer integrates racer?

Matthew Piziak
  • 5,958
  • 3
  • 29
  • 77

2 Answers2

2

Since rust-clippy normally works at compile time, it should get integrated into whatever you are using for compiling Rust code in Emacs (e.g. cargo-minor-mode). This is touched on in this blog post on setting up Emacs for Rust, in case you have not seen it already.

Atheriel
  • 21
  • 1
1

When you use rust-analyzer via lsp-mode you can tell it to use clippy as the default linter via (setq lsp-rust-analyzer-cargo-watch-command "clippy") (normally it would use check).

The config presented in this guide uses it by default.