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 E525 (root dune missing dune-warnings)

+58
+1
test/cram/e525.t/bad/dune-project
··· 1 + (lang dune 3.21)
+1
test/cram/e525.t/bad/foo/foo.opam
··· 1 + opam-version: "2.0"
+1
test/cram/e525.t/good/dune-project
··· 1 + (lang dune 3.21)
+3
test/cram/e525.t/good/foo/dune
··· 1 + (env 2 + (dev 3 + (flags :standard %{dune-warnings})))
+1
test/cram/e525.t/good/foo/dune-project
··· 1 + (lang dune 3.21)
+1
test/cram/e525.t/good/foo/foo.opam
··· 1 + opam-version: "2.0"
+50
test/cram/e525.t/run.t
··· 1 + Test bad example - foo/ has .opam but no foo/dune with %{dune-warnings}: 2 + $ merlint -B -r E525 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 (1 total issues) 12 + [E525] Package root dune missing %{dune-warnings} (1 issue) 13 + Create <package>/dune containing (env (dev (flags :standard 14 + %{dune-warnings}))), and bump <package>/dune-project to (lang dune 3.21) or 15 + newer. This mirrors the workspace-root dune so that a standalone opam build of 16 + the package still enforces strict warnings under the dev profile. Reference: 17 + alcobar/dune. 18 + - (global) foo has no root dune file; add foo/dune with (env (dev (flags :standard %{dune-warnings}))) so standalone opam builds fail on warnings 19 + ✓ Test Quality (0 total issues) 20 + ✓ Interop Testing (0 total issues) 21 + ✓ Code Generation (0 total issues) 22 + 23 + ╭───────────────────┬──────────────────────────────────────────────────╮ 24 + │ Category │ Issues │ 25 + ├───────────────────┼──────────────────────────────────────────────────┤ 26 + │ Project Structure │ 1 (1 package root dune missing %{dune-warnings}) │ 27 + ╰───────────────────┴──────────────────────────────────────────────────╯ 28 + 29 + 30 + Summary: ✗ 1 total issue (applied 1 rule) 31 + ✗ Some checks failed. See details above. 32 + [1] 33 + 34 + Test good example - foo/ has dune enabling %{dune-warnings} and modern dune-project: 35 + $ merlint -B -r E525 good/ 36 + Running merlint analysis... 37 + 38 + Analyzing 0 files 39 + 40 + ✓ Code Quality (0 total issues) 41 + ✓ Code Style (0 total issues) 42 + ✓ Naming Conventions (0 total issues) 43 + ✓ Documentation (0 total issues) 44 + ✓ Project Structure (0 total issues) 45 + ✓ Test Quality (0 total issues) 46 + ✓ Interop Testing (0 total issues) 47 + ✓ Code Generation (0 total issues) 48 + 49 + Summary: ✓ 0 total issues (applied 1 rule) 50 + ✓ All checks passed!