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 E803 (interop test shells out to oracle)

+55
+1
test/cram/e803.t/bad/dune-project
··· 1 + (lang dune 3.21)
+1
test/cram/e803.t/bad/foo/test/interop/oracle/test.ml
··· 1 + let () = ignore (Sys.command "true")
+1
test/cram/e803.t/good/dune-project
··· 1 + (lang dune 3.21)
+4
test/cram/e803.t/good/foo/test/interop/oracle/test.ml
··· 1 + let () = 2 + let ic = open_in "traces/sample.bin" in 3 + ignore (input_char ic); 4 + close_in ic
+48
test/cram/e803.t/run.t
··· 1 + Test bad example - test.ml calls Sys.command: 2 + $ merlint -B -r E803 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 (1 total issues) 14 + [E803] Interop test requires external tool (1 issue) 15 + Interop tests must run from committed traces without needing the external tool 16 + at test time. The test.ml should only read trace files, never shell out to run 17 + the oracle. If you need the oracle, put it in the generator script. 18 + - (global) Interop test bad/foo/test/interop/oracle/test.ml calls Sys.command — test must run from traces alone 19 + ✓ Code Generation (0 total issues) 20 + 21 + ╭─────────────────┬───────────────────────────────────────────╮ 22 + │ Category │ Issues │ 23 + ├─────────────────┼───────────────────────────────────────────┤ 24 + │ Interop Testing │ 1 (1 interop test requires external tool) │ 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 - test.ml only reads trace files: 33 + $ merlint -B -r E803 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!