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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"definitions":{"commonComponents":{"description":"All project packages can import this components, useful for utils packages like 'models'","items":{"title":"component name","type":"string"},"title":"List of components names","type":"array"},"commonVendors":{"description":"All project packages can import this vendor libs","items":{"title":"vendor name","type":"string"},"title":"List of vendor names","type":"array"},"component":{"additionalProperties":false,"properties":{"in":{"anyOf":[{"$ref":"#/definitions/componentIn"},{"items":{"$ref":"#/definitions/componentIn"},"type":"array"}]}},"required":["in"],"type":"object"},"componentIn":{"description":"relative directory name, support glob masking (src/\\*/engine/\\*\\*)","examples":["src/services","src/services/*/repo","src/*/services/**"],"title":"relative path to project package","type":"string"},"components":{"additionalProperties":{"$ref":"#/definitions/component"},"title":"List of components","type":"object"},"dependencies":{"additionalProperties":{"$ref":"#/definitions/dependencyRule"},"title":"Dependency rules between spec and package imports","type":"object"},"dependencyRule":{"additionalProperties":false,"properties":{"anyProjectDeps":{"description":"all component code can import any other project code, useful for DI/main component","title":"Allow import any project package?","type":"boolean"},"anyVendorDeps":{"description":"all component code can import any vendor code","title":"Allow import any vendor package?","type":"boolean"},"canUse":{"items":{"title":"vendor name","type":"string"},"title":"List of allowed vendors to import","type":"array"},"deepScan":{"description":"you can turn on/off deepScan only for this component","title":"Override deepscan global flag for this component","type":"boolean"},"mayDependOn":{"items":{"title":"component name","type":"string"},"title":"List of allowed components to import","type":"array"}},"type":"object"},"exclude":{"items":{"title":"list of directories (relative path) for exclude from analyse","type":"string"},"title":"Excluded folders from analyse","type":"array"},"excludeFiles":{"description":"package will by excluded in all package files is matched by provided regexp's","items":{"title":"regular expression rules for file names, will exclude this files and it's packages from analyse","type":"string","x-intellij-language-injection":"regexp"},"title":"Excluded files from analyse matched by regexp","type":"array"},"settings":{"additionalProperties":false,"properties":{"deepScan":{"title":"will use new advanced AST linter (this default=true from v3+)","type":"boolean"},"depOnAnyVendor":{"title":"allow import any vendor code to any project file","type":"boolean"}},"title":"Global Scheme options","type":"object"},"vendor":{"additionalProperties":false,"properties":{"in":{"anyOf":[{"$ref":"#/definitions/vendorIn"},{"items":{"$ref":"#/definitions/vendorIn"},"type":"array"}]}},"required":["in"],"type":"object"},"vendorIn":{"description":"one or more import path of vendor libs, support glob masking (src/\\*/engine/\\*\\*)","examples":["golang.org/x/mod/modfile","example.com/*/libs/**",["gopkg.in/yaml.v2","github.com/mailru/easyjson"]],"title":"full import path to vendor","type":"string"},"vendors":{"additionalProperties":{"$ref":"#/definitions/vendor"},"title":"List of vendor libs","type":"object"},"version":{"description":"Defines arch file syntax and file validation rules","maximum":3,"minimum":3,"title":"Scheme Version","type":"integer"},"workdir":{"description":"Linter will prepend all path's in project with this relative path prefix (relative directory for analyse)","title":"Working directory","type":"string"}},"description":"Arch file scheme version 3","id":"https://github.com/fe3dback/go-arch-lint/v3","properties":{"allow":{"$ref":"#/definitions/settings"},"commonComponents":{"$ref":"#/definitions/commonComponents"},"commonVendors":{"$ref":"#/definitions/commonVendors"},"components":{"$ref":"#/definitions/components"},"deps":{"$ref":"#/definitions/dependencies"},"exclude":{"$ref":"#/definitions/exclude"},"excludeFiles":{"$ref":"#/definitions/excludeFiles"},"vendors":{"$ref":"#/definitions/vendors"},"version":{"$ref":"#/definitions/version"},"workdir":{"$ref":"#/definitions/workdir"}},"required":["version","components","deps"],"title":"Go Arch Lint V3","type":"object"} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# yaml-language-server: $schema=./.go-arch-lint-schema.json | ||
version: 3 | ||
workdir: . | ||
components: | ||
controller: { in: backend/controller/** } | ||
ftl-controller-cmd: { in: cmd/ftl-controller/** } | ||
common: { in: common/** } | ||
internal: { in: internal/** } | ||
dal: { in: backend/dal/** } | ||
protos: { in: backend/protos/** } | ||
schema: { in: backend/schema/** } | ||
ftl: { in: . } | ||
ftl-cmd: { in: cmd/ftl/** } | ||
go-runtime: { in: go-runtime/** } | ||
jvm-runtime: { in: jvm-runtime/** } | ||
rust-runtime: { in: rust-runtime/** } | ||
runner: { in: backend/runner/** } | ||
ftl-runner-cmd: { in: cmd/ftl-runner/** } | ||
frontend: { in: frontend/** } | ||
ftl-gen-lsp-cmd: { in: cmd/ftl-gen-lsp/** } | ||
ftl-initdb-cmd: { in: cmd/ftl-initdb/** } | ||
ftl-schema-cmd: { in: cmd/ftl-schema/** } | ||
lint-commit-or-rollback-cmd: { in: cmd/lint-commit-or-rollback/** } | ||
databasetesting: { in: backend/controller/sql/databasetesting/** } | ||
sql: { in: backend/controller/sql/** } | ||
# TODO: Nothing outside of the go-runtime package should depend on reflection. | ||
reflection: { in: go-runtime/ftl/reflection/** } | ||
# TODO: Nothing outside of the go-runtime package should depend on reflection. | ||
encoding: { in: go-runtime/encoding/** } | ||
leases: { in: backend/controller/leases/** } | ||
|
||
excludeFiles: | ||
- ".*/testdata/.*" | ||
- ".*/\\.ftl/.*" | ||
- "/examples/.*" | ||
- "/jvm-runtime/.*" | ||
|
||
allow: | ||
depOnAnyVendor: true | ||
|
||
commonComponents: | ||
- common | ||
- internal | ||
- dal | ||
- protos | ||
- schema | ||
- ftl | ||
|
||
deps: | ||
controller: | ||
mayDependOn: | ||
- controller | ||
- frontend | ||
runner: | ||
mayDependOn: | ||
- common | ||
- internal | ||
- runner | ||
go-runtime: | ||
mayDependOn: | ||
- common | ||
- internal | ||
- go-runtime | ||
ftl-cmd: | ||
mayDependOn: | ||
- controller | ||
- common | ||
- internal | ||
- dal | ||
- protos | ||
- schema | ||
- ftl | ||
- jvm-runtime # TODO: When we decouple runtimes, this should be removed. | ||
- go-runtime # TODO: When we decouple runtimes, this should be removed. | ||
ftl-controller-cmd: | ||
mayDependOn: | ||
- controller | ||
- common | ||
- internal | ||
- dal | ||
- protos | ||
- schema | ||
- ftl | ||
ftl-runner-cmd: | ||
mayDependOn: | ||
- common | ||
- internal | ||
- runner | ||
ftl-initdb-cmd: | ||
mayDependOn: | ||
- databasetesting | ||
databasetesting: | ||
mayDependOn: | ||
- common | ||
- internal | ||
- dal | ||
- sql | ||
sql: | ||
mayDependOn: | ||
- common | ||
- internal | ||
- sql | ||
- leases |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hermit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.go-arch-lint-1.11.4.pkg |
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.
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.