fe3dback / go-arch-lint

GoLang architecture linter (checker) tool. Will check all project import path and compare with arch rules defined in yml file. Useful for hexagonal / onion / ddd / mvc and other architectural patterns. Tool can by used in your CI
MIT License
263 stars 12 forks source link

Improve config validation #43

Open fe3dback opened 1 year ago

fe3dback commented 1 year ago
SealOfTime commented 8 months ago

If enabled depOnAnyVendor forces consumers to avoid any specific rules regarding vendors, then it'd be harder to switch from not linting vendoring to linting it.

IMO, best workflow would be achieved by making it so presence of vendor-related parameters in deps overrides depOnAnyVendor, so disabling depOnAnyVendor can be done incrementally in big projects:

  1. depOnAnyVendor allows all components to use whatever they want
  2. one component gets cleaned up and all its dependencies are evaluated, so it gets a specific rule, which restricts it from getting over-coupled again. Meanwhile, all other components can still depend on whatever vendors, they were depending before
  3. then repeat second step until all components get specific rules
  4. set depOnAnyVendor to false
  5. Voila!
fe3dback commented 8 months ago

Yes, interesting idea, it would be more convenient to add rules gradually than to include them all at once in the whole project.