How possible is a clippy-like linter for OCaml?

I actually thought about creating this kind of linter by myself. I think it will be very helpful for beginner students to study OCaml, because they are making same c+±like code and I’m tired to review it.

I’m not too familiar with dune, so I have a few questions/remarks:

  1. Should it be executed during compilation or in another pass, like inline_tests are implemented?
  2. I think in a nearest future we will need an access to type information, so it should be supported somehow.
  3. In long-run we will need libraries (that provide some kind of DSL) to export linter suggestions for this DSL. It will allow us to generate suggestions like concat + map => concat_map without hardcoding it into linter.