Opinionated OCaml linter with Merlin integration for code quality, naming conventions, and style checks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

merlint E900: remove hardcoded space-wire exclusion

The rule should be simple: Wire.Codec.v without c/ → E900.
Fix the package, not the rule.

-6
-6
lib/rules/e900.ml
··· 2 2 3 3 type payload = { package : string } 4 4 5 - (** Walk <pkg>/lib/*.ml looking for Wire.Codec or Wire.Field usage. If found and 6 - <pkg>/c/ doesn't exist, flag it. *) 7 5 let check (ctx : Context.project) = 8 6 let root = ctx.project_root in 9 7 let try_readdir d = ··· 17 15 if 18 16 Sys.file_exists pkg_dir && Sys.is_directory pkg_dir && pkg <> "_build" 19 17 && pkg <> ".git" && pkg <> "_opam" 20 - (* space-wire has its own C generation approach *) 21 - && pkg <> "space-wire" 22 18 then 23 19 let lib_dir = Filename.concat pkg_dir "lib" in 24 20 if Sys.file_exists lib_dir && Sys.is_directory lib_dir then ··· 37 33 (Filename.concat lib_dir f) 38 34 In_channel.input_all 39 35 in 40 - (* Only flag packages that define codecs, not ones 41 - that just consume them *) 42 36 Astring.String.is_infix ~affix:"Wire.Codec.v " content 43 37 || Astring.String.is_infix ~affix:"Codec.v \"" content 44 38 with _ -> false)