svix / svix-webhooks

The enterprise-ready webhooks service 🦀
https://www.svix.com
MIT License
2.42k stars 167 forks source link

Use clippy::pedantic #279

Closed SuperFluffy closed 3 months ago

SuperFluffy commented 2 years ago

Feature Request

Run clippy in pedantic mode, -W clippy::pedantic.

Motivation

Right now clippy is run in standard mode, which is quite lenient and does not catch a lot of common nits. clippy::pedantic very rarely has false positives, but from experience it catches style mistakes that even relatively experienced rust devs make (looking at myself here....). Its suggestions will help very much with long term maintenance and enforce a stricter programming style. Especially when on-boarding new devs without Rust experience pedantic clippy acts as a teacher. :-)

This should be done ASAP while the code base is relatively small (at the time of writing, clippy raises 81 warnings). Adding this later on will be painful.

Proposal

Require -W clippy::pedantic in CI. This will require a bigger PR to implement all clippy suggestions so that CI passes.

Alternatives

tasn commented 2 years ago

Great suggestion, thanks a lot!

CC @svix-daniel who also brought it up yesterday. :)

svix-jplatte commented 3 months ago

We had a few PRs for this that were all closed because the benefits of the changes were not very clear. I've tried clippy::pedantic a few times in other projects and also never found it to be very useful.

We are running some non-default lints now (for example, here we enabled rust_2018_idioms, a rustc lint group), but clippy::pedantic seems to large and controversial of a lint group.