Run Mortise rules in CI
Mortise, the desktop app for laravel-modules, keeps its boundary rules in mortise.json at the project root.
Larch runs the same rules in Pest, so CI checks what Mortise shows.
Add the preset
Section titled “Add the preset”Create one test:
<?php
arch()->preset()->mortise();Run it:
./vendor/bin/pest tests/Arch/MortiseTest.phpThe preset is one Pest test. A failure lists the breaks of each rule under its name.
Change the rules
Section titled “Change the rules”Edit the rules in Mortise, or edit mortise.json:
{ "rules": { "no-circular-use": true, "public-surface-only": { "enabled": true, "folders": ["Contracts", "Events"] } }}Without the file, both rules are on, with the folders Contracts and Events.
Leave a module out
Section titled “Leave a module out”Turn the module off in modules_statuses.json at the project root. A module that is off breaks no rule, and no link to it does.
Related
Section titled “Related”- Mortise preset reference
- Adopt Larch in an existing app: the preset works with the baseline.