12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485(********************************************************************************)(* crs - A tool for managing code review comments embedded in source code *)(* Copyright (C) 2024-2025 Mathieu Barbin <mathieu.barbin@gmail.com> *)(* *)(* This file is part of crs. *)(* *)(* crs is free software; you can redistribute it and/or modify it under the *)(* terms of the GNU Lesser General Public License as published by the Free *)(* Software Foundation either version 3 of the License, or any later version, *)(* with the LGPL-3.0 Linking Exception. *)(* *)(* crs is distributed in the hope that it will be useful, but WITHOUT ANY *)(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *)(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *)(* the file `NOTICE.md` at the root of this repository for more details. *)(* *)(* You should have received a copy of the GNU Lesser General Public License *)(* and the LGPL-3.0 Linking Exception along with this library. If not, see *)(* <http://www.gnu.org/licenses/> and <https://spdx.org>, respectively. *)(********************************************************************************)moduleAnnotation_severity=structtypet=|Error|Warning|Info[@@derivingof_yojson,sexp_of]endopen!Ppx_yojson_conv_lib.Yojson_conv.PrimitivesmoduleUser_handle=structtypet=Vcs.User_handle.t[@@derivingsexp_of]lett_of_yojsonjson=json|>string_of_yojson|>Vcs.User_handle.vendtypet={default_repo_owner:User_handle.toption[@yojson.option][@sexp.option];user_mentions_whitelist:User_handle.tlistoption[@yojson.option][@sexp.option];invalid_crs_annotation_severity:Annotation_severity.toption[@yojson.option][@sexp.option];crs_due_now_annotation_severity:Annotation_severity.toption[@yojson.option][@sexp.option]}[@@derivingof_yojson,sexp_of]letcreate?default_repo_owner?user_mentions_whitelist?invalid_crs_annotation_severity?crs_due_now_annotation_severity()={default_repo_owner;user_mentions_whitelist;invalid_crs_annotation_severity;crs_due_now_annotation_severity};;letempty={default_repo_owner=None;user_mentions_whitelist=None;invalid_crs_annotation_severity=None;crs_due_now_annotation_severity=None};;letload_exn~path=matchYojson_five.Safe.from_file(Fpath.to_stringpath)with|Errormsg->Err.raise~loc:(Loc.of_file~path)[Pp.text"Not a valid json file.";Pp.textmsg]|Okjson->(matcht_of_yojsonjsonwith|t->t|exceptionPpx_yojson_conv_lib.Yojson_conv.Of_yojson_error(exn,json)->Err.raise~loc:(Loc.of_file~path)Pp.O.[Pp.text"Invalid config.";Pp.text"In: "++Pp.text(Yojson.Safe.to_stringjson);Err.exnexn]);;