From da5ca39c8b4415f60a22b8a58a2f616ff2dc8510 Mon Sep 17 00:00:00 2001 From: Max Baumann Date: Wed, 8 Jan 2025 21:33:57 +0100 Subject: [PATCH] chore: tagliatelle (#917) --- .golangci.yaml | 18 +++++++++++++++++- cmd/spice/spice.go | 6 +++--- .../internal/property/events/v1/events.go | 2 +- .../internal/task/events/v1/events.go | 2 +- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 254a75c74..3de18040d 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -39,7 +39,6 @@ linters: - protogetter # TODO - revive # TODO - stylecheck # TODO - - tagliatelle # TODO - testpackage # TODO linters-settings: @@ -47,3 +46,20 @@ linters-settings: ignore-tests: true min-occurrences: 2 ignore-strings: '(true|false)' # regex + tagliatelle: + case: + use-field-name: true + rules: + json: snake + yaml: camel + xml: snake + toml: snake + bson: snake + avro: snake + mapstructure: snake + env: upperSnake + envconfig: upperSnake + overrides: + - pkg: user-svc/internal/hwkc + rules: + json: camel diff --git a/cmd/spice/spice.go b/cmd/spice/spice.go index 11df869c6..5fcfbb1ac 100644 --- a/cmd/spice/spice.go +++ b/cmd/spice/spice.go @@ -28,9 +28,9 @@ var CLI struct { Schema struct{} `cmd:"" help:"Print SpiceDB schema"` Test struct{} `cmd:"" help:"Runs SpiceDB tests using zed"` Directory string `flag:"" short:"d" type:"path" default:"./spicedb" help:"SpiceDB directory"` - Endpoint string `flag:"" short:"e" env:"ZED_ENDPOINT" help:"e.g., 'spicedb:50051'"` - Token string `flag:"" short:"t" env:"ZED_TOKEN" help:"SpiceDB token"` - Insecure bool `flag:"" default:"false" env:"ZED_INSECURE" help:"connect over plaintext connection"` + Endpoint string `flag:"" short:"e" env:"ZED_ENDPOINT" help:"e.g., 'spicedb:50051'"` //nolint:tagliatelle,lll + Token string `flag:"" short:"t" env:"ZED_TOKEN" help:"SpiceDB token"` //nolint:tagliatelle,lll + Insecure bool `flag:"" default:"false" env:"ZED_INSECURE" help:"connect over plaintext connection"` //nolint:tagliatelle,lll } func main() { diff --git a/services/property-svc/internal/property/events/v1/events.go b/services/property-svc/internal/property/events/v1/events.go index 3fe8a7ee0..e6df49f7e 100644 --- a/services/property-svc/internal/property/events/v1/events.go +++ b/services/property-svc/internal/property/events/v1/events.go @@ -153,7 +153,7 @@ func NewFieldTypeDataSelectOptionsRemovedEvent( } type FieldTypeDataSelectOptionsUpsertedEvent struct { - UpsertedSelectOptions []models.UpdateSelectOption `json:"UpsertedSelectOptions"` + UpsertedSelectOptions []models.UpdateSelectOption `json:"upserted_select_options"` } func NewFieldTypeDataSelectOptionsUpsertedEvent( diff --git a/services/tasks-svc/internal/task/events/v1/events.go b/services/tasks-svc/internal/task/events/v1/events.go index 32d3ce566..f367d244e 100644 --- a/services/tasks-svc/internal/task/events/v1/events.go +++ b/services/tasks-svc/internal/task/events/v1/events.go @@ -85,7 +85,7 @@ type SubtaskDeletedEvent struct { } type TaskStatusUpdatedEvent struct { - Status string `json:"subtask_id"` + Status string `json:"status"` } func NewTaskCreatedEvent(