Rules
Rules turn an architecture decision into an executable check.
Most rules are scoped to a component:
component :models, in: "app/models/**/*.rb"
component :controllers, in: "app/controllers/**/*.rb"
models.cannot_use :controllers
ArchSpec reports each violation with its message and rule id, the offending code, and the evidence it found. Use the rule id for suppressions. The JSON format (--format json) adds the confidence and the stable id the todo file matches on.
Rule Families
Suppressing a Rule
Prefer a narrow suppression with a reason:
# archspec:disable-next-line dependencies.forbid -- legacy admin export
Admin::UsersController
Suppression forms:
archspec:disable-next-line RULE -- reason
archspec:disable-line RULE -- reason
archspec:disable RULE -- reason
archspec:enable RULE