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: add cram test for E900 (Wire.Codec without c/ directory)

bad/ has foo/lib/foo.ml using Wire.Codec but no c/gen.ml — flagged
because EverParse 3D files and C validators have to be regenerated
from the Wire codec, and the c/ directory is where that lives.
good/ adds c/gen.ml that calls Wire_3d.main; lint passes.

+53
+1
test/cram/e900.t/bad/dune-project
··· 1 + (lang dune 3.21)
+1
test/cram/e900.t/bad/foo/lib/foo.ml
··· 1 + let codec = Wire.Codec.v "foo" reader writer
+1
test/cram/e900.t/good/dune-project
··· 1 + (lang dune 3.21)
+1
test/cram/e900.t/good/foo/c/gen.ml
··· 1 + let () = Wire_3d.main [ Foo.codec ]
+1
test/cram/e900.t/good/foo/lib/foo.ml
··· 1 + let codec = Wire.Codec.v "foo" reader writer
+48
test/cram/e900.t/run.t
··· 1 + Test bad example - foo uses Wire.Codec but has no c/ directory: 2 + $ merlint -B -r E900 bad/ 3 + Running merlint analysis... 4 + 5 + Analyzing 0 files 6 + 7 + ✓ Code Quality (0 total issues) 8 + ✓ Code Style (0 total issues) 9 + ✓ Naming Conventions (0 total issues) 10 + ✓ Documentation (0 total issues) 11 + ✓ Project Structure (0 total issues) 12 + ✓ Test Quality (0 total issues) 13 + ✓ Interop Testing (0 total issues) 14 + ✗ Code Generation (1 total issues) 15 + [E900] Wire.Codec without c/ directory (1 issue) 16 + Add a c/ directory with gen.ml that calls Wire_3d.main to generate .3d files 17 + and C validators from the Wire codec definitions. See ocaml-clcw/c/ for the 18 + pattern. 19 + - (global) foo uses Wire.Codec but has no c/ directory for EverParse 3D generation 20 + 21 + ╭─────────────────┬───────────────────────────────────────╮ 22 + │ Category │ Issues │ 23 + ├─────────────────┼───────────────────────────────────────┤ 24 + │ Code Generation │ 1 (1 wire.codec without c/ directory) │ 25 + ╰─────────────────┴───────────────────────────────────────╯ 26 + 27 + 28 + Summary: ✗ 1 total issue (applied 1 rule) 29 + ✗ Some checks failed. See details above. 30 + [1] 31 + 32 + Test good example - foo uses Wire.Codec and has a c/ directory: 33 + $ merlint -B -r E900 good/ 34 + Running merlint analysis... 35 + 36 + Analyzing 0 files 37 + 38 + ✓ Code Quality (0 total issues) 39 + ✓ Code Style (0 total issues) 40 + ✓ Naming Conventions (0 total issues) 41 + ✓ Documentation (0 total issues) 42 + ✓ Project Structure (0 total issues) 43 + ✓ Test Quality (0 total issues) 44 + ✓ Interop Testing (0 total issues) 45 + ✓ Code Generation (0 total issues) 46 + 47 + Summary: ✓ 0 total issues (applied 1 rule) 48 + ✓ All checks passed!