Skip to content
Snippets Groups Projects
Commit 5e5ca704 authored by Patrick Baudin's avatar Patrick Baudin
Browse files

[lint] prints the number of checked files

parent 92b235d5
No related branches found
No related tags found
No related merge requests found
...@@ -373,11 +373,12 @@ let check_indent ~indent_formatter ~update file = ...@@ -373,11 +373,12 @@ let check_indent ~indent_formatter ~update file =
(* Main checks *) (* Main checks *)
let check ~verbose ~update file params = let check ~count ~verbose ~update file params =
if verbose then if verbose then
Format.printf "Checking %s@." file ; Format.printf "Checking %s@." file ;
if Sys .is_directory file then () if Sys .is_directory file then ()
else begin else begin
incr count;
let in_chan = open_in file in let in_chan = open_in file in
let content = read_buffered in_chan in let content = read_buffered in_chan in
close_in in_chan ; close_in in_chan ;
...@@ -469,6 +470,8 @@ let () = ...@@ -469,6 +470,8 @@ let () =
updates_tbl external_formatters ; updates_tbl external_formatters ;
parse_config !config_file; parse_config !config_file;
collect @@ lines_from_in stdin ; collect @@ lines_from_in stdin ;
Hashtbl.iter (check ~verbose:!verbose ~update:!update) table ; let count = ref 0 in
Hashtbl.iter (check ~count ~verbose:!verbose ~update:!update) table ;
Format.printf "Lint %d file(s)@." !count;
if not !res then exit 1 if not !res then exit 1
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment