Skip to content

Commit

Permalink
Minor formatting change with ocamlformat
Browse files Browse the repository at this point in the history
  • Loading branch information
punchagan committed Dec 4, 2024
1 parent c103ebd commit f0b3658
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
14 changes: 6 additions & 8 deletions opam-ci-check/lib/lint.ml
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,17 @@ module Checks = struct
if is_build then (pkg, DuneIsBuild) :: errors else errors
| None -> []


let check_maintainer_contact ~pkg opam =
let is_present bug_reports = bug_reports <> [] in
let includes_an_email maintainers =
List.exists
(fun m -> Str.string_match (Str.regexp ".*<?.*@.*>?") m 0)
maintainers
(fun m -> Str.string_match (Str.regexp ".*<?.*@.*>?") m 0)
maintainers
in
let bug_reports = OpamFile.OPAM.bug_reports opam in
let maintainers = OpamFile.OPAM.maintainer opam in
if is_present bug_reports || includes_an_email maintainers then
[]
else
[ (pkg, MaintainerWithoutContact maintainers) ]
if is_present bug_reports || includes_an_email maintainers then []
else [ (pkg, MaintainerWithoutContact maintainers) ]

let check_tags ~pkg opam =
(* Check if any of the default tags are present *)
Expand Down Expand Up @@ -324,7 +321,8 @@ module Checks = struct
let dash_underscore p0 p1 =
let f = function
| '_' | '-' -> None
| c -> Some (Char.lowercase_ascii c) in
| c -> Some (Char.lowercase_ascii c)
in
let p0 = p0 |> String.to_seq |> Seq.filter_map f in
let p1 = p1 |> String.to_seq |> Seq.filter_map f in
Seq.equal Char.equal p0 p1
Expand Down
2 changes: 1 addition & 1 deletion opam-ci-check/lib/lint.mli
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
include module type of Lint_error

module Checks : sig
val package_name_collision: string -> string -> bool
val package_name_collision : string -> string -> bool
(** [package_name_collision p0 p1] returns true if [p0] is similar to [p1].
Similarity is defined to be:
Expand Down
9 changes: 5 additions & 4 deletions opam-ci-check/lib/lint_error.ml
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,11 @@ let msg_of_error (package, (err : error)) =
Printf.sprintf "Error in %s: %s" pkg warn
| MaintainerWithoutContact maintainer ->
Printf.sprintf
"Error in %s: There is no way to contact the maintainer(s) '%s'. A package \
must either specify a url for 'bug-reports' or provide an email \
address in the 'maintainer' field."
pkg (String.concat ", " maintainer)
"Error in %s: There is no way to contact the maintainer(s) '%s'. A \
package must either specify a url for 'bug-reports' or provide an \
email address in the 'maintainer' field."
pkg
(String.concat ", " maintainer)
| ParseError ->
Printf.sprintf "Error in %s: Failed to parse the opam file" pkg
| DefaultTagsPresent tags ->
Expand Down

0 comments on commit f0b3658

Please sign in to comment.