caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rich@annexia.org>
To: caml-list@inria.fr
Subject: [Caml-list] OCaml code style and syntax checking
Date: Tue, 4 Jul 2017 15:01:28 +0100	[thread overview]
Message-ID: <20170704140128.GA18152@annexia.org> (raw)

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.


             reply	other threads:[~2017-07-04 14:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 14:01 Richard W.M. Jones [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170704140128.GA18152@annexia.org \
    --to=rich@annexia.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).