Change lint option to be the same as preprocessing

This commit is contained in:
Rudi Grinberg 2017-12-11 18:53:12 +08:00
parent 66fc8db600
commit bfbfc0bf30
3 changed files with 18 additions and 9 deletions

View File

@ -301,14 +301,12 @@ module Preprocess_map = struct
end
module Lint = struct
type t = Pps of Preprocess.pps
type t = Preprocess_map.t
let t =
sum
[ cstr "pps" (list Pp_or_flags.t @> nil) (fun l ->
let pps, flags = Pp_or_flags.split l in
Pps { pps; flags })
]
let t = Preprocess_map.t
let default = Preprocess_map.default
let no_lint = default
end
let field_oslu name =
@ -442,6 +440,7 @@ module Buildable = struct
; libraries : Lib_dep.t list
; preprocess : Preprocess_map.t
; preprocessor_deps : Dep_conf.t list
; lint : Preprocess_map.t
; flags : Ordered_set_lang.Unexpanded.t
; ocamlc_flags : Ordered_set_lang.Unexpanded.t
; ocamlopt_flags : Ordered_set_lang.Unexpanded.t
@ -456,8 +455,8 @@ module Buildable = struct
>>= fun preprocessor_deps ->
(* CR-someday jdimino: remove this. There are still a few Jane Street packages using
this *)
field_o "lint" (Per_module.t Lint.t)
>>= fun _lint ->
field "lint" Lint.t ~default:Lint.default
>>= fun lint ->
field "modules" (fun s -> Ordered_set_lang.(map (t s)) ~f:String.capitalize_ascii)
~default:Ordered_set_lang.standard
>>= fun modules ->
@ -470,6 +469,7 @@ module Buildable = struct
return
{ preprocess
; preprocessor_deps
; lint
; modules
; libraries
; flags

View File

@ -57,6 +57,13 @@ module Preprocess_map : sig
val pps : t -> Pp.t list
end
module Lint : sig
type t = Preprocess_map.t
val no_lint : t
end
module Js_of_ocaml : sig
type t =
{ flags : Ordered_set_lang.Unexpanded.t
@ -108,6 +115,7 @@ module Buildable : sig
; libraries : Lib_dep.t list
; preprocess : Preprocess_map.t
; preprocessor_deps : Dep_conf.t list
; lint : Lint.t
; flags : Ordered_set_lang.Unexpanded.t
; ocamlc_flags : Ordered_set_lang.Unexpanded.t
; ocamlopt_flags : Ordered_set_lang.Unexpanded.t

View File

@ -49,6 +49,7 @@ let utop_of_libs (libs : Library.t list) =
(Lib_dep.direct "utop") :: (List.map libs ~f:(fun lib ->
Lib_dep.direct lib.Library.name))
; preprocess = Preprocess_map.no_preprocessing
; lint = Lint.no_lint
; preprocessor_deps = []
; flags = Ordered_set_lang.Unexpanded.standard
; ocamlc_flags = Ordered_set_lang.Unexpanded.standard