caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] OCaml code style and syntax checking
@ 2017-07-04 14:01 Richard W.M. Jones
  2017-07-04 14:03 ` Richard W.M. Jones
  2017-07-11 12:22 ` Sébastien Hinderer
  0 siblings, 2 replies; 6+ messages in thread
From: Richard W.M. Jones @ 2017-07-04 14:01 UTC (permalink / raw)
  To: caml-list

I have a need to make automated stylistic and syntax checks to
a large amount of OCaml code.  The sort of rules would be:

 - Check that indentation is used, and used consistently.

 - Excessive use of parentheses where not needed.

 - Use ( .. ) instead of begin .. end.

 - Flag uses of various Obj.* and unsafe_* functions.

It seems to me that some of these could be tested with either camlp4
or ppx.  I think if we allowed the checker to go back to the original
code (eg to see if the parser parsed as block as '(' or 'begin'),
it might be able to check all of these things.

Anyway, before I start on it I'm wondering if anyone has ever
looked at doing this kind of thing?

Rich.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-07-11 13:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-04 14:01 [Caml-list] OCaml code style and syntax checking Richard W.M. Jones
2017-07-04 14:03 ` Richard W.M. Jones
2017-07-04 14:21   ` Mark Bradley
2017-07-11 12:22 ` Sébastien Hinderer
2017-07-11 13:03   ` François Bobot
2017-07-11 13:11     ` Sébastien Hinderer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).