Skip to content

Commit c656828

Browse files
committed
use ocamldoc syntax for inline code
1 parent 00852d8 commit c656828

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

lib/action.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct
184184
in
185185
Lwt_list.iter_s notify notifications
186186

187-
(** `refresh_config_of_context ctx n` updates the current context if the configuration
188-
hasn't been loaded yet, or if the incoming request `n` is a push
187+
(** [refresh_config_of_context ctx n] updates the current context if the configuration
188+
hasn't been loaded yet, or if the incoming request [n] is a push
189189
notification containing commits that touched the config file. *)
190190
let refresh_config_of_context (ctx : Context.t) notification =
191191
let fetch_config () =

lib/api_remote.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module Slack : Api.Slack = struct
7676

7777
let bearer_token_header access_token = sprintf "Authorization: Bearer %s" (Uri.pct_encode access_token)
7878

79-
(** `send_notification ctx msg` notifies `msg.channel` with the payload `msg`;
79+
(** [send_notification ctx msg] notifies [msg.channel] with the payload [msg];
8080
uses web API with access token if available, or with webhook otherwise *)
8181
let send_notification ~(ctx : Context.t) ~(msg : Slack_t.post_message_req) =
8282
log#info "sending to %s" msg.channel;

lib/atd_adapters.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module Branch_filters_adapter = List_or_default_field.Make (struct
4848
end)
4949

5050
(** Error detection in Slack API response. The web API communicates errors using
51-
an `error` field rather than status codes. Note, on the other hand, that
51+
an [error] field rather than status codes. Note, on the other hand, that
5252
webhooks do use status codes to communicate errors. *)
5353
module Slack_response_adapter : Atdgen_runtime.Json_adapter.S = struct
5454
let normalize (x : Yojson.Safe.t) =

lib/context.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ let hook_of_channel ctx channel_name =
4646
| Some hook -> Some hook.url
4747
| None -> None
4848

49-
(** `is_pipeline_allowed ctx p` returns `true` if ctx.config.status_rules
49+
(** [is_pipeline_allowed ctx p] returns [true] if [ctx.config.status_rules]
5050
doesn't define a whitelist of allowed pipelines, or if the list
51-
contains pipeline `p`; returns `false` otherwise. *)
51+
contains pipeline [p]; returns [false] otherwise. *)
5252
let is_pipeline_allowed ctx ~pipeline =
5353
match ctx.config with
5454
| None -> true

lib/github.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ type gh_link =
9494

9595
let gh_re = Re2.create_exn {|^(.*)/(.+)/(.+)/(commit|pull|issues)/([a-z0-9]+)/?$|}
9696

97-
(** `gh_link_of_string s` parses a URL string `s` to try to match a supported
97+
(** [gh_link_of_string s] parses a URL string [s] to try to match a supported
9898
GitHub link type, generating repository endpoints if necessary *)
9999
let gh_link_of_string url_str =
100100
let url = Uri.of_string url_str in

lib/rule.atd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ type status_rule = {
4848

4949
(* A filename matches a prefix rule with the channel name if it isn't in the ignore
5050
list and it is in the allow list. If multiple prefix rules match for a given
51-
file, the one to match with the longest prefix is used. Both `allow` and
52-
`ignore` are optional. If `allow` is undefined, then the rule matches all
51+
file, the one to match with the longest prefix is used. Both [allow] and
52+
[ignore] are optional. If [allow] is undefined, then the rule matches all
5353
payloads.
5454

5555
If a commit affects 3 files:
@@ -73,7 +73,7 @@ type prefix_rule = {
7373
} <json adapter.ocaml="Atd_adapters.Branch_filters_adapter">
7474

7575
(* A payload matches a label rule with a channel name if absent from the ignore list
76-
and present in the allow list. Both `allow` and `ignore` are optional. If `allow`
76+
and present in the allow list. Both [allow] and [ignore] are optional. If [allow]
7777
is undefined, then the rule matches all payloads. *)
7878
type label_rule = {
7979
?allow <json name="match"> : string list nullable;

lib/rule.ml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ module Status = struct
99
{ trigger = [ Success ]; condition = None; policy = Allow_once };
1010
]
1111

12-
(** `match_rules n rs` returns the policy declared by the first rule in `rs`
13-
to match status notification `n` if one exists, falling back to
14-
the default rules otherwise. A rule `r` matches `n` if `n.state` is in
15-
`r.trigger` and `n` meets `r.condition`. *)
12+
(** [match_rules n rs] returns the policy declared by the first rule in [rs]
13+
to match status notification [n] if one exists, falling back to
14+
the default rules otherwise. A rule [r] matches [n] if [n.state] is in
15+
[r.trigger] and [n] meets [r.condition]. *)
1616
let match_rules (notification : Github_t.status_notification) ~rules =
1717
let match_rule rule =
1818
let value_of_field = function
@@ -48,10 +48,10 @@ module Prefix = struct
4848
| Some main_branch -> String.equal main_branch branch
4949
| None -> distinct
5050

51-
(** `match_rules f rs` returns the channel name of a rule in `rs` that matches
52-
file name `f` with the longest prefix, if one exists. A rule `r` matches
53-
`f` with prefix length `l`, if `f` has no prefix in `r.ignore` and `l` is
54-
the length of the longest prefix of `f` in `r.allow`. An undefined or empty
51+
(** [match_rules f rs] returns the channel name of a rule in [rs] that matches
52+
file name [f] with the longest prefix, if one exists. A rule [r] matches
53+
[f] with prefix length [l], if [f] has no prefix in [r.ignore] and [l] is
54+
the length of the longest prefix of [f] in [r.allow]. An undefined or empty
5555
allow list is considered a prefix match of length 0. The ignore list is
5656
evaluated before the allow list. *)
5757
let match_rules filename ~rules =
@@ -91,9 +91,9 @@ module Prefix = struct
9191
end
9292

9393
module Label = struct
94-
(** `match_rules l rs` returns the channel names of the rules in `rs` that
95-
allow label `l`, if one exists. A rule `r` matches label `l`, if `l` is
96-
not a member of `r.ignore` and is a member of `r.allow`. The label name
94+
(** [match_rules l rs] returns the channel names of the rules in [rs] that
95+
allow label [l], if one exists. A rule [r] matches label [l], if [l] is
96+
not a member of [r.ignore] and is a member of [r.allow]. The label name
9797
comparison is case insensitive. An undefined allow list is considered a
9898
match. The ignore list is evaluated before the allow list. *)
9999
let match_rules (label : Github_t.label) ~rules =

lib/state.atd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type 'v map_as_object <ocaml from="Common"> = abstract
44
(* A map from branch names to build statuses *)
55
type branch_statuses = status_state map_as_object
66

7-
(* A map from pipeline names to `branch_statuses` maps. This tracks the
7+
(* A map from pipeline names to [branch_statuses] maps. This tracks the
88
last build state matched by the status_rules for each pipeline and
99
branch *)
1010
type pipeline_statuses = branch_statuses map_as_object

0 commit comments

Comments
 (0)