FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

audi70r/uncle-bob: Golang clean architecture linter · GitHub

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uncle-bob

Golang clean architecture linter

Description

A golang linter based on Uncle Bob's clean code concepts.

The linter builds a hierarchical model from the project directory AST and assign a level for every package used by the project (with the exception of a standart golang library). The dependency levels are defined by the imports of a higher order package. If main package is considered level 0, then all of its import will be 1. The subsequent imports of level 1 packages are respectively level 2 etc.

In plain mod, Uncle Bob will not allow same level imports.

In strict mod, Uncle Bob will only allow one level inward import (ex. level 0 can only import level 1 packages, level 1 can only import level 2 etc...)

Can by used in pipelines. If an issue is detected Uncle Bob will exit with status 1.

Linter works with go mod enabled

Usage

Build the project

$ go build

Install the linter on Linux

$ go install

For running uncle bob, go to the project root directory, where the go.mod is located and simply run

$ uncle-bob

Basic Commands

To ignore test files

$ uncle-bob -ignore-tests

Show detailed information about package imports

$ uncle-bob -package-imports=github.com/audi70r/uncle-bob/checker

Do strict checking, allow only one level inward imports

$ uncle-bob -strict

Visualizations

Uncle Bob provides multiple visualization options to help understand your project's architecture.

GraphViz DOT Output

Generate a dependency graph in DOT format (can be used with GraphViz tools)

$ uncle-bob -dot > deps.dot

HTML Visualization

Generate an interactive HTML report showing package dependencies

$ uncle-bob -html=report.html

3D Building Visualization

Generate an immersive 3D visualization of your package architecture as a building structure

$ uncle-bob -3d=architecture.html

The 3D visualization represents your architecture as a building with:

  • Each floor representing a level in Clean Architecture
  • Packages displayed as rooms on each floor
  • Dependencies shown as connections between packages
  • Different colors for entry points, utilities, and regular packages
  • Red connections highlighting violations

Interactive controls:

  • Rotate, pan and zoom to explore the structure
  • View dependencies and violations
  • Toggle exploded view to see each level separately
  • Reset view to return to the default perspective

License

Do whatever you want with it, but don't disrespect Uncle Bob!

About

Golang clean architecture linter

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL