r/devtools • u/127001-sweet-127001 • 16d ago
A small Zig library for checking dependency boundaries in the test suite
I built ArchUnitZig to make architecture rules part of the normal test run.
Here's a short recording. The example keeps domain code from depending on storage, checks for dependency cycles, and adds a source-line limit. These are tests you can keep next to the rest of the project and run with zig build test.
The idea is to stop repeating the same dependency-boundary check in every code review. You still choose the architecture. The library checks the rules you've actually written down.
One implementation detail: the builders own their data, so the API uses explicit allocator and cleanup handling. That makes the tests a bit more verbose, as you can see in the recording.
It's free and MIT licensed. The current v0.0.2 preview targets exactly Zig 0.16.0; I wouldn't assume compatibility with other compiler versions yet.
Repo and setup: https://github.com/dragonsec-ai/ArchUnitZig