Configuration
Northline reads a single YAML file, by default .northline.yaml in the repository root.
Everything else is optional: without a config the tool still reports cycles and orphan packages.
Layers
A layer is a named set of path globs. Layers are how rules stay readable when a repository has dozens of packages.
layers:
- name: domain
paths: ["src/domain/**"]
- name: app
paths: ["src/app/**"]
- name: infra
paths: ["src/infra/**", "src/db/**"]
Rules
Each rule names a source (layer or glob) and the targets it may not reach. Deny wins over allow.
rules:
- from: domain
deny: [infra, app]
- from: app
allow: [domain, app]
- from: "pkg/payments/**"
deny: ["pkg/billing/internal/**"]
message: "payments must use the billing API, not internals"
The message field is printed with the violation and lands in the SARIF result.
Ignore lists
Generated code and test fixtures usually need an exception. Ignores accept the same globs, and every entry requires a comment in the config review.
ignore:
- path: "src/gen/**"
reason: "protobuf output, checked separately"
- path: "**/*_test.go"
reason: "test fixtures import infra on purpose"
Monorepos
Workspaces are discovered from package.json, go.work,
pyproject.toml and Cargo.toml. Paths in rules are relative to the
workspace root, so the same config works whether a job checks out the whole repo or a single package.
If two workspaces declare the same module name, Northline reports the collision instead of silently picking one.