@ -16,24 +16,22 @@ let capture_text =
if Config . analyzer = Config . Linters then " linting "
if Config . analyzer = Config . Linters then " linting "
else " translating "
else " translating "
let replace_header_file_with_source_file file_path =
Option . default file_path ( DB . source_file_of_header file_path )
(* * Read the files to compile from the changed files index. *)
(* * Read the files to compile from the changed files index. *)
let should_capture_file_from_index () =
let should_capture_file_from_index () =
match DB . read_changed_files_index with
match DB . changed_source_files_set with
| None ->
| None ->
( match Config . changed_files_index with
( match Config . changed_files_index with
| Some index ->
| Some index ->
Process . print_error_and_exit " Error reading the changed files index %s. \n %! " index
Process . print_error_and_exit " Error reading the changed files index %s. \n %! " index
| None -> function _ -> true )
| None -> function _ -> true )
| Some lines ->
| Some files_set ->
let index_files_set = IList . fold_left
function source_file ->
( fun changed_files line ->
DB . SourceFileSet . mem source_file files_set | |
let file = replace_header_file_with_source_file ( DB . source_file_from_string line ) in
(* as fallback try to capture corresponding source file for headers *)
DB . SourceFileSet . add file changed_files )
Option . map_default
DB . SourceFileSet . empty lines in
( fun src -> DB . SourceFileSet . mem src files_set )
function source_file -> DB . SourceFileSet . mem source_file index_files_set
false
( DB . source_file_of_header source_file )
(* * The buck targets are assumed to start with //, aliases are not supported. *)
(* * The buck targets are assumed to start with //, aliases are not supported. *)
let check_args_for_targets args =
let check_args_for_targets args =