Original post

Import Boundary Checker is a tool to automatically check if import boundaries are violated or not. Examples of where this tool is useful:

  • Hexagonal/clean architecture where domain logic cannot import infrastructure code

  • Mono-repositories with multiple microservices where you don’t allow services to import code from other microservices

  • Layered architecture where layers cannot import certain other layers

Why is this tool useful, and why consider using it over alternative tools?

  • Import boundaries are checked automatically (meaning you don’t have to spend time in code review on manually checking)

  • It is extremely fast (sub-second speeds with medium sized projects)

  • Configuration is easy (within a few minutes you can define forbidden imports for your projects and have everything set up)

  • The tool is independent (you don’t need to change any production or testing code for the tool to work)

  • Usage of the tool requires zero dependencies (so no outside dependencies are needed for running the tool, only the source code of your project)

GitHub link to project: https://github.com/BytecodeAgency/import-boundary-checker

Feel free to give feedback on the project!