Your Clippy Config Should Be Stricter

11 points by emschwartz


freddyb

I'm only write rust for fun, not for work so I don't know if this resonates or is an accepted truth in Rust circles.

When I write Rust, I go through multiple steps.

  1. Make it work, make it compile. At this stage all short cuts are OK. panics, unwraps, copies.
  2. Make it work nice. Go through one of the category of short cuts and polish. This needs to be done iteratively, a single clippy lint one-by-one. (Some of these things aren't clippy thing. When to copy, reference or share data can be non-trivial)

I've found this to work really well for me, but again - hobby projects and for fun. I don't have code review from a peer in hobby projects, sadly :)

The conclusion also resonated with me - with an LLM writing all of the code, people will start caring less about the code. I think that's dangerous as long as your abstractions are brittle. Choosing a picky language with a picky linter can get you to code that is easier to review, if you focus on things being "explicitly right" from a cursory glance rather than "potentially correct". A linter can do parts of that cursory glance and you can tell your coding agent to produce code that is linter-green before you self-review.