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 E820 (hand-rolled CSV parsing)

+58
+1
test/cram/e820.t/bad/dune-project
··· 1 + (lang dune 3.21)
+5
test/cram/e820.t/bad/foo/test/interop/oracle/test.ml
··· 1 + let () = 2 + let ic = open_in "traces/sample.csv" in 3 + let line = input_line ic in 4 + let _fields = String.split_on_char ',' line in 5 + close_in ic
+1
test/cram/e820.t/good/dune-project
··· 1 + (lang dune 3.21)
+4
test/cram/e820.t/good/foo/test/interop/oracle/test.ml
··· 1 + let () = 2 + match Csv.decode_file "traces/sample.csv" Csv.Row.codec with 3 + | Ok _rows -> () 4 + | Error _ -> ()
+47
test/cram/e820.t/run.t
··· 1 + Test bad example - test.ml hand-rolls CSV parsing: 2 + $ merlint -B -r E820 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 + [E820] Hand-rolled CSV parsing (1 issue) 15 + Use csv (Csv.decode_file with a Csv.Row codec) for CSV trace parsing. Never 16 + hand-roll CSV readers with open_in/input_line/split_on_char. 17 + - (global) Interop test bad/foo/test/interop/oracle/test.ml hand-rolls CSV parsing instead of csv 18 + ✓ Code Generation (0 total issues) 19 + 20 + ╭─────────────────┬───────────────────────────────╮ 21 + │ Category │ Issues │ 22 + ├─────────────────┼───────────────────────────────┤ 23 + │ Interop Testing │ 1 (1 hand-rolled csv parsing) │ 24 + ╰─────────────────┴───────────────────────────────╯ 25 + 26 + 27 + Summary: ✗ 1 total issue (applied 1 rule) 28 + ✗ Some checks failed. See details above. 29 + [1] 30 + 31 + Test good example - test.ml uses csv library: 32 + $ merlint -B -r E820 good/ 33 + Running merlint analysis... 34 + 35 + Analyzing 0 files 36 + 37 + ✓ Code Quality (0 total issues) 38 + ✓ Code Style (0 total issues) 39 + ✓ Naming Conventions (0 total issues) 40 + ✓ Documentation (0 total issues) 41 + ✓ Project Structure (0 total issues) 42 + ✓ Test Quality (0 total issues) 43 + ✓ Interop Testing (0 total issues) 44 + ✓ Code Generation (0 total issues) 45 + 46 + Summary: ✓ 0 total issues (applied 1 rule) 47 + ✓ All checks passed!