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 the rule id, file, line, message, evidence, confidence, and stable id. Use the rule id for suppressions.
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