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

Commit

Permalink
Track errors as a list instead of a list option
Browse files Browse the repository at this point in the history
  • Loading branch information
shonfeder committed Aug 21, 2024
1 parent 68def2c commit a01c993
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ let lint (changed_pkgs, new_pkgs) local_repo_dir =
| Some d -> (
print_endline @@ Printf.sprintf "Linting opam-repository at %s ..." d;
match Lint.check ~new_pkgs ~changed_pkgs d with
| None ->
| [] ->
print_endline "No errors";
Ok ()
| Some errors ->
| errors ->
errors |> List.map Lint.msg_of_error |> String.concat "\n"
|> Result.error)

Expand Down
4 changes: 1 addition & 3 deletions lib/lint.ml
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,4 @@ let check ~new_pkgs ~changed_pkgs repo_dir =
List.map (run_package_lint ~newly_published:true ~repo_dir) new_pkgs
|> List.concat
in
match new_pkg_errors @ changed_errors with
| [] -> None
| errors -> Some errors
new_pkg_errors @ changed_errors

0 comments on commit a01c993

Please sign in to comment.