From 5e5ca70425d7e96cfe87ff6978afd78fbbbc0b2c Mon Sep 17 00:00:00 2001 From: Patrick Baudin <patrick.baudin@cea.fr> Date: Wed, 1 Mar 2023 11:59:30 +0100 Subject: [PATCH] [lint] prints the number of checked files --- tools/lint/lint.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/lint/lint.ml b/tools/lint/lint.ml index f4fb550b714..37e26caba6b 100644 --- a/tools/lint/lint.ml +++ b/tools/lint/lint.ml @@ -373,11 +373,12 @@ let check_indent ~indent_formatter ~update file = (* Main checks *) -let check ~verbose ~update file params = +let check ~count ~verbose ~update file params = if verbose then Format.printf "Checking %s@." file ; if Sys .is_directory file then () else begin + incr count; let in_chan = open_in file in let content = read_buffered in_chan in close_in in_chan ; @@ -469,6 +470,8 @@ let () = updates_tbl external_formatters ; parse_config !config_file; 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 end -- GitLab