generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add go-arch-lint #2421
Merged
Merged
chore: add go-arch-lint #2421
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This lints our internal software architecture. It currently does not pass, but I'm adding this to guide the refactoring changes. Current output: ``` 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/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 encoding shouldn't depend on github.com/TBD54566975/ftl/go-runtime/ftl/reflection in /Users/alec/dev/ftl/go-runtime/encoding/encoding.go:16 Component encoding shouldn't depend on github.com/TBD54566975/ftl/go-runtime/encoding in /Users/alec/dev/ftl/go-runtime/encoding/encoding_test.go:10 Component encoding shouldn't depend on github.com/TBD54566975/ftl/go-runtime/ftl in /Users/alec/dev/ftl/go-runtime/encoding/encoding_test.go:11 Component encoding shouldn't depend on github.com/TBD54566975/ftl/go-runtime/ftl/reflection in /Users/alec/dev/ftl/go-runtime/encoding/encoding_test.go:12 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/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/leader in /Users/alec/dev/ftl/internal/configuration/asm.go:13 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_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/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/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 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 ```
alecthomas
requested review from
a team and
wesbillman
and removed request for
a team
August 18, 2024 21:43
Open
gak
approved these changes
Aug 18, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea!
wesbillman
reviewed
Aug 19, 2024
@@ -0,0 +1,103 @@ | |||
# yaml-language-server: $schema=./.go-arch-lint-schema.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So many cool go tools out there! This is great.
safeer
pushed a commit
that referenced
this pull request
Aug 19, 2024
This lints our internal software architecture. It currently does not pass, but I'm adding this to guide the refactoring changes. Current output: ``` 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/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 encoding shouldn't depend on github.com/TBD54566975/ftl/go-runtime/ftl/reflection in /Users/alec/dev/ftl/go-runtime/encoding/encoding.go:16 Component encoding shouldn't depend on github.com/TBD54566975/ftl/go-runtime/encoding in /Users/alec/dev/ftl/go-runtime/encoding/encoding_test.go:10 Component encoding shouldn't depend on github.com/TBD54566975/ftl/go-runtime/ftl in /Users/alec/dev/ftl/go-runtime/encoding/encoding_test.go:11 Component encoding shouldn't depend on github.com/TBD54566975/ftl/go-runtime/ftl/reflection in /Users/alec/dev/ftl/go-runtime/encoding/encoding_test.go:12 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/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/leader in /Users/alec/dev/ftl/internal/configuration/asm.go:13 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_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/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/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 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 ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This lints our internal software architecture.
It currently does not pass, but I'm adding this to guide the refactoring changes. Current output: