From 9d803402b85613547235db82e54276e73446c252 Mon Sep 17 00:00:00 2001 From: Shon Feder Date: Sat, 10 Aug 2024 00:40:11 -0400 Subject: [PATCH] Document and specify the api for lint.ml --- lib/lint.mli | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/lint.mli diff --git a/lib/lint.mli b/lib/lint.mli new file mode 100644 index 0000000..c9b571d --- /dev/null +++ b/lib/lint.mli @@ -0,0 +1,25 @@ +include module type of Lint_error + +val check : + new_pkgs:string list -> + changed_pkgs:string list -> + string -> + (OpamPackage.t * error) list +(** [check ~new_pkgs ~changed_pkgs opam_repo] is a list of all the errors + detected while linting the [new_pkgs] and [changed_pkgs] in the context of the + opam repository located at [opam_repo]. + + @param new_pkgs Packages which are to be newly published. + @param changed_pkgs Packages that have been updated (e.g., to add maintainers + update dependency versions). + @param opam_repo The path a local opam repository. + + Examples: + + {[ + let passes_all_checks = assert (check ~new_pkgs ~changed_pkgs repo |> List.length = 0) + let failed_some_checks = assert (check ~new_pkgs ~changed_pkgs repo |> List.length > 0) + let messages_for_all_failed_checks = + check ~new_pkgs ~changed_pkgs repo + |> List.map msg_of_error + ]} *)