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.

Support allowed_words in E331 (redundant prefix); document in man page

E331 now checks ctx.config.allowed_words before flagging a name,
matching the pattern used by E300. This lets projects exempt specific
names like create_table via .merlint:

allowed_words: [create_table]

Updated the man page to document allowed_words and acronyms.

+10 -1
+8
bin/main.ml
··· 446 446 depth), and $(b,?) (single character). Use $(b,--show-config) to verify \ 447 447 the loaded configuration."; 448 448 `P 449 + "$(b,allowed_words:) — Names that should be accepted as-is by naming \ 450 + rules (E300, E331, etc.). For example, $(b,create_table) would normally \ 451 + trigger E331 (redundant prefix) but can be exempted:"; 452 + `Pre "allowed_words: [create_table]"; 453 + `P 454 + "$(b,acronyms:) is an alias for $(b,allowed_words) — both add to the \ 455 + same allowlist."; 456 + `P 449 457 "Available settings: $(b,max-complexity), $(b,max-function-length), \ 450 458 $(b,max-nesting), $(b,exempt-data-definitions), \ 451 459 $(b,max-underscores-in-name), $(b,min-name-length-underscore), \
+2 -1
lib/rules/e331.ml
··· 19 19 let check (ctx : Context.file) = 20 20 let outline_data = Context.outline ctx in 21 21 let filename = ctx.filename in 22 + let allowed = ctx.config.allowed_words in 22 23 let module_name = 23 24 Filename.basename filename |> Filename.remove_extension 24 25 |> String.lowercase_ascii ··· 65 66 let location = Outline.location filename item in 66 67 67 68 match (item.kind, location) with 68 - | Outline.Value, Some loc -> ( 69 + | Outline.Value, Some loc when not (List.mem name allowed) -> ( 69 70 (* Check for regular function prefix patterns *) 70 71 match check_function_prefix name with 71 72 | Some (prefix_type, suggested) ->