Do not parse dune-project files in ignored directories
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
This commit is contained in:
parent
d393630152
commit
e05fcb7631
|
@ -206,15 +206,15 @@ let load ?(extra_ignored_subtrees=Path.Set.empty) path =
|
||||||
~compare:(fun (a, _, _) (b, _, _) -> String.compare a b)
|
~compare:(fun (a, _, _) (b, _, _) -> String.compare a b)
|
||||||
sub_dirs
|
sub_dirs
|
||||||
in
|
in
|
||||||
let project =
|
let project, dune_file, ignored_subdirs =
|
||||||
match Dune_project.load ~dir:path ~files with
|
|
||||||
| Some x -> x
|
|
||||||
| None -> project
|
|
||||||
in
|
|
||||||
let dune_file, ignored_subdirs =
|
|
||||||
if ignored then
|
if ignored then
|
||||||
(None, String.Set.empty)
|
(project, None, String.Set.empty)
|
||||||
else
|
else
|
||||||
|
let project =
|
||||||
|
match Dune_project.load ~dir:path ~files with
|
||||||
|
| Some x -> x
|
||||||
|
| None -> project
|
||||||
|
in
|
||||||
let dune_file, ignored_subdirs =
|
let dune_file, ignored_subdirs =
|
||||||
match List.filter ["dune"; "jbuild"] ~f:(String.Set.mem files) with
|
match List.filter ["dune"; "jbuild"] ~f:(String.Set.mem files) with
|
||||||
| [] -> (None, String.Set.empty)
|
| [] -> (None, String.Set.empty)
|
||||||
|
@ -238,7 +238,7 @@ let load ?(extra_ignored_subtrees=Path.Set.empty) path =
|
||||||
else
|
else
|
||||||
ignored_subdirs
|
ignored_subdirs
|
||||||
in
|
in
|
||||||
(dune_file, ignored_subdirs)
|
(project, dune_file, ignored_subdirs)
|
||||||
in
|
in
|
||||||
let sub_dirs =
|
let sub_dirs =
|
||||||
List.fold_left sub_dirs ~init:String.Map.empty
|
List.fold_left sub_dirs ~init:String.Map.empty
|
||||||
|
|
Loading…
Reference in New Issue