OCaml implementation of the Mozilla Public Suffix service
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(lint): use Fmt instead of Printf/Format in tests

Replace Printf.sprintf with Fmt.str, Format.asprintf with Fmt.str,
Format.fprintf with Fmt.pf, and Format.formatter_of_buffer patterns
with Fmt.str "%a" across all test files.

+7 -7
+7 -7
bin/main.ml
··· 10 10 11 11 (* Helper functions for printing results *) 12 12 13 - let print_error e = Printf.printf "ERROR: %s\n" (Publicsuffix.error_to_string e) 13 + let print_error e = Fmt.pr "ERROR: %s@." (Publicsuffix.error_to_string e) 14 14 let print_result = function Ok s -> print_endline s | Error e -> print_error e 15 15 16 16 let print_bool_result = function ··· 24 24 | Publicsuffix.ICANN -> "ICANN" 25 25 | Publicsuffix.Private -> "PRIVATE" 26 26 in 27 - Printf.printf "%s (%s)\n" s sec_str 27 + Fmt.pr "%s (%s)@." s sec_str 28 28 | Error e -> print_error e 29 29 30 30 let registrable_cmd = ··· 86 86 let term = 87 87 Term.( 88 88 const (fun (total, icann, private_rules) -> 89 - Printf.printf "Total rules: %d\n" total; 90 - Printf.printf "ICANN rules: %d\n" icann; 91 - Printf.printf "Private rules: %d\n" private_rules) 89 + Fmt.pr "Total rules: %d@." total; 90 + Fmt.pr "ICANN rules: %d@." icann; 91 + Fmt.pr "Private rules: %d@." private_rules) 92 92 $ Publicsuffix_cmd.stats_term (psl ())) 93 93 in 94 94 Cmd.v info term ··· 99 99 let term = 100 100 Term.( 101 101 const (fun (version, commit) -> 102 - Printf.printf "Version: %s\n" version; 103 - Printf.printf "Commit: %s\n" commit) 102 + Fmt.pr "Version: %s@." version; 103 + Fmt.pr "Commit: %s@." commit) 104 104 $ Publicsuffix_cmd.version_term (psl ())) 105 105 in 106 106 Cmd.v info term