this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

bump indigo again, and some permission lint progress

+42 -11
+1
Makefile
··· 12 12 build: ## Build all executables 13 13 go build ./cmd/handlr 14 14 go build ./cmd/lexidex 15 + go build ./cmd/glot 15 16 16 17 .PHONY: all 17 18 all: build
+38 -10
cmd/glot/lint.go
··· 5 5 "context" 6 6 "encoding/json" 7 7 "errors" 8 - "slices" 9 8 "fmt" 10 9 "io/fs" 11 10 "log/slog" ··· 13 12 "path" 14 13 "path/filepath" 15 14 "regexp" 15 + "slices" 16 16 17 17 "github.com/bluesky-social/indigo/atproto/lexicon" 18 18 "github.com/bluesky-social/indigo/atproto/syntax" ··· 107 107 // parse file regularly 108 108 // TODO: use json/v2 when available for case-sensitivity 109 109 var sf lexicon.SchemaFile 110 - if err := json.Unmarshal(b, &sf); err != nil { 111 - return err 110 + 111 + // two-part parsing before looking at errors 112 + err = json.Unmarshal(b, &sf) 113 + if err == nil { 114 + err = sf.FinishParse() 112 115 } 113 - if err := sf.FinishParse(); err != nil { 114 - return err 116 + if err != nil { 117 + iss := LintIssue{ 118 + FilePath: p, 119 + //NSID 120 + LintLevel: "error", 121 + LintName: "schema-json-parse", 122 + LintDescription: "parsing schema JSON file", 123 + Message: err.Error(), 124 + } 125 + if cmd.Bool("json") { 126 + b, err := json.Marshal(iss) 127 + if err != nil { 128 + return nil 129 + } 130 + fmt.Println(string(b)) 131 + } else { 132 + fmt.Printf(" 🔴 %s\n", p) 133 + fmt.Printf(" [%s]: %s\n", iss.LintName, iss.Message) 134 + } 135 + return ErrLintFailures 115 136 } 116 137 117 138 issues := lintSchemaFile(p, sf) ··· 178 199 } 179 200 return nil 180 201 } 181 - 182 202 183 203 func lintSchemaFile(p string, sf lexicon.SchemaFile) []LintIssue { 184 204 issues := []LintIssue{} ··· 376 396 } 377 397 // TODO: at least one message type 378 398 case lexicon.SchemaPermissionSet: 379 - if v.Description == nil || *v.Description == "" { 380 - issues = append(issues, missingDesc()) 399 + if v.Title == nil || *v.Title == "" { 400 + issues = append(issues, LintIssue{ 401 + FilePath: p, 402 + NSID: nsid, 403 + LintLevel: "warn", 404 + LintName: "permissionset-no-title", 405 + LintDescription: "permission sets should include a title", 406 + Message: "missing title", 407 + }) 381 408 } 409 + // TODO: missing detail 382 410 // TODO: translated descriptions? 383 411 if len(v.Permissions) == 0 { 384 412 issues = append(issues, LintIssue{ 385 413 FilePath: p, 386 414 NSID: nsid, 387 415 LintLevel: "warn", 388 - LintName: "permissions-no-members", 416 + LintName: "permissionset-no-permissions", 389 417 LintDescription: "permission sets should define at least one permission", 390 418 Message: "empty permission set", 391 419 }) ··· 450 478 LintLevel: "warn", 451 479 LintName: "nullable-and-optional", 452 480 LintDescription: "object properties should not be both optional and nullable", 453 - Message: fmt.Sprintf("field is both nullabor and optional: %s", k), 481 + Message: fmt.Sprintf("field is both nullable and optional: %s", k), 454 482 }) 455 483 } 456 484 }
+1 -1
go.mod
··· 3 3 go 1.24.0 4 4 5 5 require ( 6 - github.com/bluesky-social/indigo v0.0.0-20250928221656-62c257eeff41 6 + github.com/bluesky-social/indigo v0.0.0-20250929013805-0a9fed45fba0 7 7 github.com/bluesky-social/jetstream v0.0.0-20250414024304-d17bd81a945e 8 8 github.com/carlmjohnson/versioninfo v0.22.5 9 9 github.com/earthboundkid/versioninfo/v2 v2.24.1
+2
go.sum
··· 8 8 github.com/bluesky-social/indigo v0.0.0-20250926122318-7bec8976937c/go.mod h1:n6QE1NDPFoi7PRbMUZmc2y7FibCqiVU4ePpsvhHUBR8= 9 9 github.com/bluesky-social/indigo v0.0.0-20250928221656-62c257eeff41 h1:OwDMKlp/ELWdYD/Q47MZ5dtS9ZvyE/zxE+owwQ1Xqw0= 10 10 github.com/bluesky-social/indigo v0.0.0-20250928221656-62c257eeff41/go.mod h1:n6QE1NDPFoi7PRbMUZmc2y7FibCqiVU4ePpsvhHUBR8= 11 + github.com/bluesky-social/indigo v0.0.0-20250929013805-0a9fed45fba0 h1:6EzjQjANF1PsJgtUnVlFwjm+0gzV3f3P2JldpMlVK50= 12 + github.com/bluesky-social/indigo v0.0.0-20250929013805-0a9fed45fba0/go.mod h1:n6QE1NDPFoi7PRbMUZmc2y7FibCqiVU4ePpsvhHUBR8= 11 13 github.com/bluesky-social/jetstream v0.0.0-20250414024304-d17bd81a945e h1:P/O6TDHs53gwgV845uDHI+Nri889ixksRrh4bCkCdxo= 12 14 github.com/bluesky-social/jetstream v0.0.0-20250414024304-d17bd81a945e/go.mod h1:WiYEeyJSdUwqoaZ71KJSpTblemUCpwJfh5oVXplK6T4= 13 15 github.com/carlmjohnson/versioninfo v0.22.5 h1:O00sjOLUAFxYQjlN/bzYTuZiS0y6fWDQjMRvwtKgwwc=