Northline v0.14.2

Fail the build when a forbidden dependency sneaks in

Northline walks a repository, builds a graph of modules and packages, and compares it against rules you keep in version control. One static binary, no agents, no runtime to install.

# beta build, preinstalled in the pilot runner image
northline --version

# check the graph against .northline.yaml
northline check --config .northline.yaml --fail-on new

# 12 edges checked, 1 violation (payments -> billing/internal)
Example: northline check reporting two violations

What it does

Graph from source

Reads imports, workspace manifests and lockfiles. No build required, so it runs in a two-minute CI job.

Rules as code

Allow and deny lists per layer, per package, per team. Rules live next to the code and are reviewed like everything else.

Diff mode

--fail-on new fails only on edges introduced by the branch, so legacy debt does not block the team.

Cycles and orphans

Reports strongly connected components and packages nobody imports — usually dead code waiting to be deleted.

SARIF output

Upload findings to GitHub code scanning or any SARIF viewer; each violation points at the exact import line.

Offline

No telemetry, no registry lookups. The binary reads the checkout and writes a report.

Rules look like this

# .northline.yaml
layers:
  - name: domain
    paths: ["src/domain/**"]
  - name: infra
    paths: ["src/infra/**"]

rules:
  - from: domain
    deny: [infra]          # domain must not import infra
  - from: "pkg/payments/**"
    deny: ["pkg/billing/internal/**"]

Exit codes: 0 clean, 1 violations, 2 config error.

Documentation

Quickstart

Install, write the first rule, wire it into CI — about ten minutes.

Configuration

Layers, rules, ignore lists and how paths are resolved in monorepos.

CLI reference

Every flag, exit code and output format, including SARIF and JSON.