this repo has no description
at main 108 lines 4.1 kB view raw
1let capitalize_ascii = Astring.String.Ascii.capitalize 2 3let bad_markup : ?suggestion:string -> string -> Loc.span -> Warning.t = 4 fun ?suggestion -> Warning.make ?suggestion "'%s': bad markup." 5 6let leading_zero_in_heading_level : string -> Loc.span -> Warning.t = 7 Warning.make "'%s': leading zero in heading level." 8 9let should_not_be_empty : what:string -> Loc.span -> Warning.t = 10 fun ~what -> Warning.make "%s should not be empty." (capitalize_ascii what) 11 12let markup_should_not_be_used : what:string -> Loc.span -> Warning.t = 13 fun ~what -> 14 Warning.make "%s should not be used because it has no effect." 15 (capitalize_ascii what) 16 17let should_begin_on_its_own_line : what:string -> Loc.span -> Warning.t = 18 fun ~what -> 19 Warning.make "%s should begin on its own line." (capitalize_ascii what) 20 21let should_be_followed_by_whitespace : what:string -> Loc.span -> Warning.t = 22 fun ~what -> 23 Warning.make "%s should be followed by space, a tab, or a new line." 24 (capitalize_ascii what) 25 26let not_allowed : 27 ?suggestion:string -> what:string -> in_what:string -> Loc.span -> Warning.t 28 = 29 fun ?suggestion ~what ~in_what -> 30 Warning.make ?suggestion "%s is not allowed in %s." (capitalize_ascii what) 31 in_what 32 33let unclosed_bracket : 34 ?suggestion:string -> bracket:string -> Loc.span -> Warning.t = 35 fun ?suggestion ~bracket -> 36 Warning.make ?suggestion "Open bracket '%s' is never closed." bracket 37 38let no_leading_whitespace_in_verbatim : Loc.span -> Warning.t = 39 Warning.make "'{v' should be followed by whitespace." 40 41let not_enough_indentation_in_code_block : what:string -> Loc.span -> Warning.t 42 = 43 fun ~what -> 44 Warning.make "%ss should be indented at the opening `{`." 45 (String.capitalize_ascii what) 46 47let no_trailing_whitespace_in_verbatim : Loc.span -> Warning.t = 48 Warning.make "'v}' should be preceded by whitespace." 49 50let stray_at : Loc.span -> Warning.t = Warning.make "Stray '@'." 51 52let stray_cr : Loc.span -> Warning.t = 53 Warning.make "Stray '\\r' (carriage return character)." 54 55let truncated_before : Loc.span -> Warning.t = 56 Warning.make "'@before' expects version number on the same line." 57 58let truncated_param : Loc.span -> Warning.t = 59 Warning.make "'@param' expects parameter name on the same line." 60 61let truncated_raise : string -> Loc.span -> Warning.t = 62 Warning.make "'%s' expects exception constructor on the same line." 63 64let truncated_see : Loc.span -> Warning.t = 65 Warning.make 66 "'@see' should be followed by <url>, 'file', or \"document title\"." 67 68let truncated_string : Loc.span -> Warning.t = 69 Warning.make "Truncated string literal" 70 71let unknown_tag : string -> Loc.span -> Warning.t = 72 Warning.make "Unknown tag '%s'." 73 74let unpaired_right_brace : Loc.span -> Warning.t = 75 Warning.make ~suggestion:"try '\\}'." "Unpaired '}' (end of markup)." 76 77let unpaired_right_bracket : Loc.span -> Warning.t = 78 Warning.make ~suggestion:"try '\\]'." "Unpaired ']' (end of code)." 79 80let no_language_tag_in_meta : Loc.span -> Warning.t = 81 Warning.make ~suggestion:"try '{[ ... ]}' or '{@ocaml[ ... ]}'." 82 "'{@' should be followed by a language tag." 83 84let language_tag_invalid_char lang_tag : char -> Loc.span -> Warning.t = 85 let suggestion = "try '{@" ^ lang_tag ^ "[ ... ]}'." in 86 Warning.make ~suggestion "Invalid character '%c' in language tag." 87 88let code_block_tag_invalid_char : char -> Loc.span -> Warning.t = 89 Warning.make "Invalid character in code block metadata tag '%c'." 90 91let invalid_char_code : int -> Loc.span -> Warning.t = 92 Warning.make "Invalid escape sequence '\\%d" 93 94let truncated_code_block_meta : Loc.span -> Warning.t = 95 Warning.make ~suggestion:"try '{@ocaml[ ... ]}'." "Missing end of code block." 96 97let truncated_code_block : Loc.span -> Warning.t = 98 Warning.make ~suggestion:"add ']}'." "Missing end of code block." 99 100let end_not_allowed : in_what:string -> Loc.span -> Warning.t = 101 fun ~in_what -> 102 Warning.make ~suggestion:"add '}'." "End of text is not allowed in %s." 103 in_what 104 105let should_not_be_escaped : char -> Loc.span -> Warning.t = 106 fun c -> 107 Warning.make ~suggestion:"Remove \\." 108 "The '%c' character should not be escaped." c