Dune: How to customize Merlin warnings (custom FLG)?

Created on 14 Feb 2018  路  3Comments  路  Source: ocaml/dune

jbuilder build --dev selects a longer list of warnings than by default, but how would we go about specifying our own combination of warnings?

--dev adds a number of warnings to the default list at https://github.com/ocaml/dune/blob/master/src/ocaml_flags.ml#L11-L21 and at https://github.com/ocaml/dune/blob/master/src/ocaml_flags.ml#L27-L30

Is there a way to override these? I think I'd be happy with a command-line option like --warnings <warnings> (or -w <warnings>) which would define the warnings to use for compiling and for writing into the merlin file.

Most helpful comment

You can specify a clause in your jbuild file inside your library or executable stanzas

(flags (:standard _ _ _))

I'm replying on my phone so I might have the exact invocation wrong. But you can search for the (flags ...) documentation to get more info

All 3 comments

You can specify a clause in your jbuild file inside your library or executable stanzas

(flags (:standard _ _ _))

I'm replying on my phone so I might have the exact invocation wrong. But you can search for the (flags ...) documentation to get more info

Additionally, when we switch to dune they'll be a way to set the default flags globally for a project

Works great. Thanks guys. Can't wait for the dune release.

Our jbuild files now include a shared flags file:

(executable
 ((name run_tests)
  (flags (:include ../flags))
  (libraries (foo))))

The flags file at the root of the project is something like:

(:standard
  -w -4-33-40-41-42-43-34-44
  -short-paths
  -strict-sequence
  -strict-formats
  -short-paths
  -keep-locs
)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

bobot picture bobot  路  7Comments

bbc2 picture bbc2  路  7Comments

rgrinberg picture rgrinberg  路  6Comments

c-cube picture c-cube  路  7Comments

anton-trunov picture anton-trunov  路  3Comments