package crs

  1. Overview
  2. Docs
A tool for managing code review comments embedded in source code

Install

Dune Dependency

Authors

Maintainers

Sources

crs-0.0.20250705.tbz
sha256=e9f9f5ec5aea9658ed640aaa06f887985bb6870adcf7555ebf6d48bb741e4793
sha512=901ac1caae6c4103a320b4a3a177ca3aa0583ad533c54e7740aba6652ccdbd6311d07ab4b73e3ba750beed24f85479b5e1b0e94504ecfd0c59bd49cdabebc369

doc/src/crs.reviewdog/severity.ml.html

Source file severity.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(****************************************************************************)
(*  ocaml-reviewdog - A reviewdog diagnostics json serializer for OCaml     *)
(*  SPDX-FileCopyrightText: 2025 Mathieu Barbin <mathieu.barbin@gmail.com>  *)
(*  SPDX-License-Identifier: MIT                                            *)
(****************************************************************************)

type t =
  | Unknown_severity
  | Error
  | Warning
  | Info
[@@deriving compare, equal, enumerate]

let of_string = function
  | "UNKNOWN_SEVERITY" -> Unknown_severity
  | "ERROR" -> Error
  | "WARNING" -> Warning
  | "INFO" -> Info
  | str -> failwith (Printf.sprintf "Invalid severity: %s" str)
;;

let to_string = function
  | Unknown_severity -> "UNKNOWN_SEVERITY"
  | Error -> "ERROR"
  | Warning -> "WARNING"
  | Info -> "INFO"
;;

let yojson_of_t t = `String (to_string t)

let t_of_yojson json =
  match (json : Yojson.Safe.t) with
  | `String str | `List [ `String str ] -> of_string str
  | json -> failwith (Printf.sprintf "Invalid severity: %s" (Yojson.Safe.to_string json))
;;
OCaml

Innovation. Community. Security.