package crs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Cr_comment.User_handleSource

A user handle as it appears in CR comments and related metadata (such as pull request author).

This type is more permissive than a git username Vcs.User_handle.t, in order to capture certain usages across platforms such as GitHub, GitLab, etc. For example, square brackets are allowed to accommodate bot account names on GitHub (e.g., dependabot[bot] as PRs author).

The supported character set is:

  • alphanumeric characters
  • - (hyphen)
  • _ (underscore)
  • . (dot)
  • [ and ] (square brackets)
Sourcetype t
Sourceval compare : t -> t -> int
Sourceval equal : t -> t -> bool
Sourceval to_string : t -> string
Sourceval to_dyn : t -> Crs_stdlib.Dyn.t
Sourceval to_json : t -> Crs_stdlib.Json.t
Sourceval of_json : Crs_stdlib.Json.t -> t
Sourceval of_string : string -> (t, [ `Msg of string ]) Crs_stdlib.Result.t

of_string str returns Ok str if the string is a valid user handle, and an error otherwise. This is meant to be used to validate untrusted entries.

Sourceval v : string -> t

v str is a convenient wrapper to build a t or raise Invalid_argument. This is typically handy for applying on trusted literals.