Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .tsk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[encapsulation]
allow-generated-construction = true
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
do not convey their meaning. Do not use naked returns.
- Keep every comment to at most two lines.
- Document every public symbol.
- `bit lint-tsk` runs the `tsk` linters; `tsk config` lists them. Keep an
intentional finding with a `//nolint:<linter> <reason>` comment at the end of
its line or on its own line above the statement.

# Optional values

Expand All @@ -66,8 +69,6 @@
- Keep nil checks on required arguments; those values are not optional.
- Read values with `Get()` or `Default()` and handle the absent case. Never call
`MustGet()` outside tests; the linter rejects it.
- `bit lint-optional` reports nil used as an absent value. Keep an intentional
nil with an `//optionalnil:allow <reason>` comment on or above its line.
- Tag optional JSON fields with `omitzero`, not `omitempty`.
- `Option` decodes JSON with `json.Unmarshal`, ignoring decoder settings such as
`DisallowUnknownFields`. A type held in an `Option` must enforce strict
Expand Down
20 changes: 7 additions & 13 deletions BUILD.bit
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,6 @@ lint-go[go-module] = go.lint {
dir = go-module
depends_on = [sample-proto]
}
lint-encapsulation[go-module] = exec.test {
command = "encapsulation-linter -allow-generated-construction ./..."
dir = go-module
inputs = ["#{go-module}/**/*.go", "#{go-module}/go.mod", "#{go-module}/go.sum", "bin/.encapsulation-linter-0.2.0.pkg"]
depends_on = [build-go]
}
lint-optional[go-module] = exec.test {
command = "optionalnil ./..."
dir = go-module
inputs = ["#{go-module}/**/*.go", "#{go-module}/go.mod", "#{go-module}/go.sum", "go.mod", "go.sum", "cmd/optionalnil/*.go", "scripts/optionalnil", "scripts/spectre-ingress"]
depends_on = [build-go]
}
lint-proto = exec.test {
command = "buf lint"
inputs = ["buf.yaml", "internal/sample/proto/*.proto", "bin/.buf-1.73.0.pkg"]
Expand All @@ -105,6 +93,12 @@ lint-scripts = exec {
command = "shellcheck scripts/*"
inputs = ["scripts/*", "bin/.shellcheck-0.11.0.pkg"]
}
lint-tsk[go-module] = exec.test {
command = "tsk"
dir = go-module
inputs = ["#{go-module}/**/*.go", "#{go-module}/go.mod", "#{go-module}/go.sum", ".tsk.toml", "bin/.tsktsk-0.2.0.pkg"]
depends_on = [build-go]
}

explicit sample-bin = go.exe {
package = "./cmd/spectre-sample"
Expand Down Expand Up @@ -149,7 +143,7 @@ target publish-container(registry : string, image-tag : string, version : string
target test = [test-go, test-comment-length, test-launcher, test-response-comparison-integration, test-release-version, test-container-publisher]

# Lint everything
target lint = [lint-go, lint-encapsulation, lint-optional, lint-proto, lint-actions, lint-action-pins, lint-dockerfile, lint-release, lint-scripts, fmt-check-go]
target lint = [lint-go, lint-tsk, lint-proto, lint-actions, lint-action-pins, lint-dockerfile, lint-release, lint-scripts, fmt-check-go]

# Format everything
target fmt = [fmt-go, fmt-action-pins]
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion bin/docker
1 change: 0 additions & 1 deletion bin/encapsulation-linter

This file was deleted.

1 change: 1 addition & 0 deletions bin/tsk
8 changes: 0 additions & 8 deletions cmd/optionalnil/main.go

This file was deleted.

Loading
Loading