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.
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
)
Most helpful comment
You can specify a clause in your jbuild file inside your library or executable stanzas
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