Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Document and specify the api for lint.ml
Browse files Browse the repository at this point in the history
  • Loading branch information
shonfeder committed Aug 21, 2024
1 parent 70af3d9 commit 9d80340
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lib/lint.mli
Original file line number Diff line number Diff line change
@@ -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
]} *)

0 comments on commit 9d80340

Please sign in to comment.