ocaml / dune

A composable build system for OCaml.
https://dune.build/
MIT License
1.62k stars 401 forks source link

Is it possible to run linters before applying ppxs #1950

Open leamingrad opened 5 years ago

leamingrad commented 5 years ago

Our codebase makes use of a hand-rolled AST-based linter that we apply using the following field in a library stanza:

(lint (pps cs_lint --null))

Currently our linter is finding issues with ppx-generated code that is added as part of the build in a preprocess field.

Is it possible to configure dune so that the linting is run before the pre-processing?

ghost commented 5 years ago

That does seem odd indeed. I thought linters where applied on the source code but looking again at the code they indeed seem to be applied after the ppx rewriters. @rgrinberg, I remember that we discussed this at some point, do you remember why we did it that way?

rgrinberg commented 5 years ago

That just seems like a bug to me. We indeed talked about this and wanted linting to be done the source code.

ghost commented 5 years ago

Ok, let's call it a bug then