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
256 stars 12 forks source link

`--output-json-one-line` doesn't seemingly have any effect #62

Open alecthomas opened 2 months ago

alecthomas commented 2 months ago

For example, I would expect the following to output JSON:

🐚 ~/dev/ftl $ go-arch-lint check --output-json-one-line
module: github.com/TBD54566975/ftl
linters:
   On | Base: component imports # always on
  Off | Advanced: vendor imports # switch 'allow.depOnAnyVendor = false' (or delete) to on
   On | Advanced: method calls and dependency injections # switch 'allow.deepScan = true' (or delete) to on

Component controller shouldn't depend on github.com/TBD54566975/ftl/go-runtime/encoding in /Users/alec/dev/ftl/backend/controller/admin/admin.go:13
Component controller shouldn't depend on github.com/TBD54566975/ftl/frontend in /Users/alec/dev/ftl/backend/controller/controller.go:55
Component controller shouldn't depend on github.com/TBD54566975/ftl in /Users/alec/dev/ftl/backend/controller/controller.go:37
Component controller shouldn't depend on github.com/TBD54566975/ftl/go-runtime/encoding in /Users/alec/dev/ftl/backend/controller/ingress/handler_test.go:20
Component controller shouldn't depend on github.com/TBD54566975/ftl/go-runtime/encoding in /Users/alec/dev/ftl/backend/controller/ingress/request_test.go:15
Component controller shouldn't depend on github.com/TBD54566975/ftl/go-runtime/ftl in /Users/alec/dev/ftl/backend/controller/ingress/request_test.go:16
Component controller shouldn't depend on github.com/TBD54566975/ftl/backend/runner in /Users/alec/dev/ftl/backend/controller/scaling/localscaling/local_scaling.go:16
Component internal shouldn't depend on github.com/TBD54566975/ftl/go-runtime/compile in /Users/alec/dev/ftl/internal/buildengine/build_go.go:8
Component internal shouldn't depend on github.com/TBD54566975/ftl in /Users/alec/dev/ftl/internal/buildengine/build_java.go:10
Component internal shouldn't depend on github.com/TBD54566975/ftl/go-runtime/compile in /Users/alec/dev/ftl/internal/buildengine/stubs.go:10
Component internal shouldn't depend on github.com/TBD54566975/ftl/go-runtime/compile in /Users/alec/dev/ftl/internal/buildengine/watch.go:11
Component internal shouldn't depend on github.com/TBD54566975/ftl/backend/controller/leases in /Users/alec/dev/ftl/internal/configuration/asm.go:14
Component internal shouldn't depend on github.com/TBD54566975/ftl/backend/controller/leader in /Users/alec/dev/ftl/internal/configuration/asm.go:13
Component internal shouldn't depend on github.com/TBD54566975/ftl/backend/controller/leader in /Users/alec/dev/ftl/internal/configuration/asm_follower.go:13
Component internal shouldn't depend on github.com/TBD54566975/ftl/backend/controller/leases in /Users/alec/dev/ftl/internal/configuration/asm_test.go:16
Component internal shouldn't depend on github.com/TBD54566975/ftl/backend/controller/sql/sqltest in /Users/alec/dev/ftl/internal/configuration/dal/dal_test.go:9
Component internal shouldn't depend on github.com/TBD54566975/ftl/backend/controller/leases in /Users/alec/dev/ftl/internal/configuration/sql/models.go:13
Component internal shouldn't depend on github.com/TBD54566975/ftl/backend/controller/sql/sqltypes in /Users/alec/dev/ftl/internal/configuration/sql/models.go:14
Component internal shouldn't depend on github.com/TBD54566975/ftl/backend/controller/sql in /Users/alec/dev/ftl/internal/configuration/sql/types.go:3
Component internal shouldn't depend on github.com/TBD54566975/ftl/go-runtime/encoding in /Users/alec/dev/ftl/internal/modulecontext/from_secrets.go:8
Component internal shouldn't depend on github.com/TBD54566975/ftl in /Users/alec/dev/ftl/internal/projectconfig/projectconfig.go:14
Component internal shouldn't depend on github.com/TBD54566975/ftl in /Users/alec/dev/ftl/internal/projectconfig/projectconfig_test.go:9
Component internal shouldn't depend on github.com/TBD54566975/ftl in /Users/alec/dev/ftl/internal/rpc/context.go:14
File /.ftl/go/modules/builtin/external_module.go not attached to any component in archfile
alecthomas commented 2 months ago

I will note that --output json does what one would expect though!

fe3dback commented 2 months ago

hi, --output-json-one-line is optional parameter for --json. It affects the JSON output format (one line vs formatted).

alecthomas commented 2 months ago

Ah I see. I missed that in the help, though an error would have been helpful I think.