ocaml-ppx / ppxlib

Base library and tools for ppx rewriters
MIT License
244 stars 94 forks source link

Add an -unused-type-warnings flag to the driver #493

Closed NathanReb closed 2 days ago

NathanReb commented 1 month ago

This allows disabling the generation of let _ = fun (_ : t) -> () strucutre items for each type using derivers.

The feature was meant to automatically disable warning 34 when using [@@deriving ...].

This is based on top of #492 to ease testing for the feature, only the last commit is relevant.

NathanReb commented 1 month ago

CC @mbarbin, if you want to test this feature.

CC @ceastlund, I'd be curious to know if you get any warnings when enabling this flag for JS' codebase.

mbarbin commented 1 month ago

I created a preview package that includes this change, and tested it in a PR in a project that could benefits from that. I was able to remove my hack and coverage stayed at 100%. :+1:

mbarbin commented 2 days ago

@patricoferris We were discussing with @NathanReb and I've made an attempt to implement this feature on top of another PR, see #511 . I am not sure which matches best what Nathan had in mind, just giving you the heads up.

NathanReb commented 2 days ago

Yes this PR is a bit out of date now. Since @mbarbin started working on the right implem, I'd prefer to take his contributions! Let's close this!