Monorepo for Tangled tangled.org

tangled: correct typos throughout codebase #1300

merged opened by eti.tf targeting master from eti.tf/core-2: eti/typos

Fix various misspellings found by the typos tool:

  • Error messages: Forbiden -> Forbidden, insufficent -> insufficient
  • Comments and docs: recieve -> receive, acheive -> achieve, etc.
  • Variable names: Referencs -> References, intialize -> initialize
  • HTML templates: Unubscribe -> Unsubscribe, explictly -> explicitly
  • Function names: perferom -> perform

Also remove backwards compat code for is_deafult JSON field.

Add _typos.toml config for false positives (external APIs, etc.)

Signed-off-by: eti eti@eti.tf

Labels

None yet.

assignee

None yet.

Participants 3
AT URI
at://did:plc:xu5apv6kmu5jp7g5hwdnej42/sh.tangled.repo.pull/3miytxt2koq22
+85 -83
Diff #0
+23
_typos.toml
··· 1 + [files] 2 + # Don't check these files 3 + extend-exclude = [ 4 + ".git/", 5 + "*.lock", 6 + "go.mod", 7 + "go.sum", 8 + ] 9 + 10 + [default.extend-words] 11 + # False positives - words that typos incorrectly flags 12 + # Go variable name commonly used for NiceDiff 13 + "nd" = "nd" 14 + # Acronym for "Does Not Exist" used in label operations 15 + "DNE" = "DNE" 16 + # CSS class for syntax highlighting (other) 17 + "ot" = "ot" 18 + # Brand name HashiCorp 19 + "Hashi" = "Hashi" 20 + # External API from goldmark-callout package (unfixable upstream typo) 21 + "Extention" = "Extention" 22 + # External API from goldmark package (unfixable upstream typo) 23 + "Precending" = "Precending"
+4 -4
appview/db/issues.go
··· 252 252 } 253 253 254 254 // collect references for each issue 255 - allReferencs, err := GetReferencesAll(e, orm.FilterIn("from_at", issueAts)) 255 + allReferences, err := GetReferencesAll(e, orm.FilterIn("from_at", issueAts)) 256 256 if err != nil { 257 257 return nil, fmt.Errorf("failed to query reference_links: %w", err) 258 258 } 259 - for issueAt, references := range allReferencs { 259 + for issueAt, references := range allReferences { 260 260 if issue, ok := issueMap[issueAt.String()]; ok { 261 261 issue.References = references 262 262 } ··· 452 452 453 453 // collect references for each comments 454 454 commentAts := slices.Collect(maps.Keys(commentMap)) 455 - allReferencs, err := GetReferencesAll(e, orm.FilterIn("from_at", commentAts)) 455 + allReferences, err := GetReferencesAll(e, orm.FilterIn("from_at", commentAts)) 456 456 if err != nil { 457 457 return nil, fmt.Errorf("failed to query reference_links: %w", err) 458 458 } 459 - for commentAt, references := range allReferencs { 459 + for commentAt, references := range allReferences { 460 460 if comment, ok := commentMap[commentAt.String()]; ok { 461 461 comment.References = references 462 462 }
+5 -5
appview/db/notifications.go
··· 191 191 return nil, fmt.Errorf("failed to parse created timestamp: %w", err) 192 192 } 193 193 194 - nwe := &models.NotificationWithEntity{Notification: &n} 194 + entry := &models.NotificationWithEntity{Notification: &n} 195 195 196 196 // populate repo if present 197 197 if rId.Valid { ··· 211 211 if rTopicStr.Valid { 212 212 repo.Topics = strings.Fields(rTopicStr.String) 213 213 } 214 - nwe.Repo = &repo 214 + entry.Repo = &repo 215 215 } 216 216 217 217 // populate issue if present ··· 229 229 if iOpen.Valid { 230 230 issue.Open = iOpen.Bool 231 231 } 232 - nwe.Issue = &issue 232 + entry.Issue = &issue 233 233 } 234 234 235 235 // populate pull if present ··· 247 247 if pState.Valid { 248 248 pull.State = models.PullState(pState.Int64) 249 249 } 250 - nwe.Pull = &pull 250 + entry.Pull = &pull 251 251 } 252 252 253 - notifications = append(notifications, nwe) 253 + notifications = append(notifications, entry) 254 254 } 255 255 256 256 return notifications, nil
+2 -2
appview/db/pulls.go
··· 487 487 488 488 // collect references for each comments 489 489 commentAts := slices.Collect(maps.Keys(commentMap)) 490 - allReferencs, err := GetReferencesAll(e, orm.FilterIn("from_at", commentAts)) 490 + allReferences, err := GetReferencesAll(e, orm.FilterIn("from_at", commentAts)) 491 491 if err != nil { 492 492 return nil, fmt.Errorf("failed to query reference_links: %w", err) 493 493 } 494 - for commentAt, references := range allReferencs { 494 + for commentAt, references := range allReferences { 495 495 if comment, ok := commentMap[commentAt.String()]; ok { 496 496 comment.References = references 497 497 }
+2 -2
appview/indexer/issues/indexer.go
··· 48 48 // Init initializes the indexer 49 49 func (ix *Indexer) Init(ctx context.Context, e db.Execer) { 50 50 l := tlog.FromContext(ctx) 51 - existed, err := ix.intialize(ctx) 51 + existed, err := ix.initialize(ctx) 52 52 if err != nil { 53 53 log.Fatalln("failed to initialize issue indexer", err) 54 54 } ··· 117 117 return mapping, nil 118 118 } 119 119 120 - func (ix *Indexer) intialize(ctx context.Context) (bool, error) { 120 + func (ix *Indexer) initialize(ctx context.Context) (bool, error) { 121 121 if ix.indexer != nil { 122 122 return false, errors.New("indexer is already initialized") 123 123 }
+2 -2
appview/indexer/pulls/indexer.go
··· 47 47 // Init initializes the indexer 48 48 func (ix *Indexer) Init(ctx context.Context, e db.Execer) { 49 49 l := tlog.FromContext(ctx) 50 - existed, err := ix.intialize(ctx) 50 + existed, err := ix.initialize(ctx) 51 51 if err != nil { 52 52 log.Fatalln("failed to initialize pull indexer", err) 53 53 } ··· 112 112 return mapping, nil 113 113 } 114 114 115 - func (ix *Indexer) intialize(ctx context.Context) (bool, error) { 115 + func (ix *Indexer) initialize(ctx context.Context) (bool, error) { 116 116 if ix.indexer != nil { 117 117 return false, errors.New("indexer is already initialized") 118 118 }
+2 -2
appview/indexer/repos/indexer.go
··· 51 51 // Init initializes the indexer 52 52 func (ix *Indexer) Init(ctx context.Context, e db.Execer) { 53 53 l := tlog.FromContext(ctx) 54 - existed, err := ix.intialize(ctx) 54 + existed, err := ix.initialize(ctx) 55 55 if err != nil { 56 56 log.Fatalln("failed to initialize repo indexer", err) 57 57 } ··· 188 188 return mapping, nil 189 189 } 190 190 191 - func (ix *Indexer) intialize(ctx context.Context) (bool, error) { 191 + func (ix *Indexer) initialize(ctx context.Context) (bool, error) { 192 192 if ix.indexer != nil { 193 193 return false, errors.New("indexer is already initialized") 194 194 }
+2 -2
appview/ingester.go
··· 818 818 return fmt.Errorf("failed to get registration: %w", err) 819 819 } 820 820 if len(registrations) != 1 { 821 - return fmt.Errorf("got incorret number of registrations: %d, expected 1", len(registrations)) 821 + return fmt.Errorf("got incorrect number of registrations: %d, expected 1", len(registrations)) 822 822 } 823 823 registration := registrations[0] 824 824 ··· 1100 1100 } 1101 1101 repo = i[0].Repo 1102 1102 default: 1103 - return fmt.Errorf("unsupport label subject: %s", collection) 1103 + return fmt.Errorf("unsupported label subject: %s", collection) 1104 1104 } 1105 1105 1106 1106 actx, err := db.NewLabelApplicationCtx(ddb, orm.FilterIn("at_uri", repo.Labels))
+1 -1
appview/issues/issues.go
··· 602 602 603 603 _, err = db.AddIssueComment(tx, newComment) 604 604 if err != nil { 605 - l.Error("failed to perferom update-description query", "err", err) 605 + l.Error("failed to perform update-description query", "err", err) 606 606 rp.pages.Notice(w, "repo-notice", "Failed to update description, try again later.") 607 607 return 608 608 }
+6 -6
appview/knots/knots.go
··· 97 97 return 98 98 } 99 99 if len(registrations) != 1 { 100 - l.Error("got incorret number of registrations", "got", len(registrations), "expected", 1) 100 + l.Error("got incorrect number of registrations", "got", len(registrations), "expected", 1) 101 101 return 102 102 } 103 103 registration := registrations[0] ··· 285 285 return 286 286 } 287 287 if len(registrations) != 1 { 288 - l.Error("got incorret number of registrations", "got", len(registrations), "expected", 1) 288 + l.Error("got incorrect number of registrations", "got", len(registrations), "expected", 1) 289 289 fail() 290 290 return 291 291 } ··· 394 394 return 395 395 } 396 396 if len(registrations) != 1 { 397 - l.Error("got incorret number of registrations", "got", len(registrations), "expected", 1) 397 + l.Error("got incorrect number of registrations", "got", len(registrations), "expected", 1) 398 398 fail() 399 399 return 400 400 } ··· 485 485 return 486 486 } 487 487 if len(registrations) != 1 { 488 - l.Error("got incorret number of registrations", "got", len(registrations), "expected", 1) 488 + l.Error("got incorrect number of registrations", "got", len(registrations), "expected", 1) 489 489 fail() 490 490 return 491 491 } ··· 521 521 return 522 522 } 523 523 if len(registrations) != 1 { 524 - l.Error("got incorret number of registrations", "got", len(registrations), "expected", 1) 524 + l.Error("got incorrect number of registrations", "got", len(registrations), "expected", 1) 525 525 return 526 526 } 527 527 registration := registrations[0] ··· 629 629 return 630 630 } 631 631 if len(registrations) != 1 { 632 - l.Error("got incorret number of registrations", "got", len(registrations), "expected", 1) 632 + l.Error("got incorrect number of registrations", "got", len(registrations), "expected", 1) 633 633 return 634 634 } 635 635
+5 -5
appview/middleware/middleware.go
··· 124 124 if actor == nil { 125 125 // we need a logged in user 126 126 l.Warn("not logged in, redirecting") 127 - http.Error(w, "Forbiden", http.StatusUnauthorized) 127 + http.Error(w, "Forbidden", http.StatusUnauthorized) 128 128 return 129 129 } 130 130 domain := chi.URLParam(r, "domain") ··· 136 136 ok, err := mw.enforcer.E.HasGroupingPolicy(actor.Active.Did, group, domain) 137 137 if err != nil || !ok { 138 138 l.Warn("permission denied", "did", actor.Active.Did, "group", group, "domain", domain) 139 - http.Error(w, "Forbiden", http.StatusUnauthorized) 139 + http.Error(w, "Forbidden", http.StatusUnauthorized) 140 140 return 141 141 } 142 142 ··· 158 158 if actor == nil { 159 159 // we need a logged in user 160 160 l.Warn("not logged in, redirecting") 161 - http.Error(w, "Forbiden", http.StatusUnauthorized) 161 + http.Error(w, "Forbidden", http.StatusUnauthorized) 162 162 return 163 163 } 164 164 f, err := mw.repoResolver.Resolve(r) ··· 170 170 ok, err := mw.enforcer.E.Enforce(actor.Active.Did, f.Knot, f.RepoIdentifier(), requiredPerm) 171 171 if err != nil || !ok { 172 172 l.Warn("permission denied", "did", actor.Active.Did, "perm", requiredPerm, "repo", f.RepoIdentifier()) 173 - http.Error(w, "Forbiden", http.StatusUnauthorized) 173 + http.Error(w, "Forbidden", http.StatusUnauthorized) 174 174 return 175 175 } 176 176 ··· 332 332 // a 404 like tangled.sh/oppi.li/go-git/v5 333 333 // 334 334 // we're keeping the tangled.sh go-import tag too to maintain backward 335 - // compatiblity for modules that still point there. they will be redirected 335 + // compatibility for modules that still point there. they will be redirected 336 336 // to fetch source from tangled.org 337 337 func (mw Middleware) GoImport() middlewareFunc { 338 338 return func(next http.Handler) http.Handler {
+1 -1
appview/models/notifications.go
··· 104 104 case NotificationTypeIssueClosed: 105 105 return prefs.IssueClosed 106 106 case NotificationTypeIssueReopen: 107 - return prefs.IssueCreated // smae pref for now 107 + return prefs.IssueCreated // same pref for now 108 108 case NotificationTypePullCreated: 109 109 return prefs.PullCreated 110 110 case NotificationTypePullCommented:
+1 -1
appview/pages/markup/reference_link.go
··· 16 16 17 17 // FindReferences collects all links referencing tangled-related objects 18 18 // like issues, PRs, comments or even @-mentions 19 - // This funciton doesn't actually check for the existence of records in the DB 19 + // This function doesn't actually check for the existence of records in the DB 20 20 // or the PDS; it merely returns a list of what are presumed to be references. 21 21 func FindReferences(host string, source string) ([]string, []models.ReferenceLink) { 22 22 var (
+1 -1
appview/pages/pages.go
··· 52 52 } 53 53 54 54 func NewPages(config *config.Config, res *idresolver.Resolver, database *db.DB, logger *slog.Logger) *Pages { 55 - // initialized with safe defaults, can be overriden per use 55 + // initialized with safe defaults, can be overridden per use 56 56 rctx := &markup.RenderContext{ 57 57 IsDev: config.Core.Dev, 58 58 Hostname: config.Core.AppviewHost,
+1 -1
appview/pages/templates/repo/pipelines/workflow.html
··· 12 12 {{ block "sidebar" . }} {{ end }} 13 13 </div> 14 14 <div class="col-span-1 md:col-span-3"> 15 - <!-- TODO(boltless): explictly check for pipeline cancel permission --> 15 + <!-- TODO(boltless): explicitly check for pipeline cancel permission --> 16 16 {{ if $.RepoInfo.Roles.IsOwner }} 17 17 <div class="flex justify-between mb-2"> 18 18 <div id="workflow-error" class="text-red-500 dark:text-red-400"></div>
+1 -1
appview/pages/templates/repo/settings/general.html
··· 103 103 <p> 104 104 </div> 105 105 <form class="col-span-1 md:col-span-1 md:justify-self-end"> 106 - {{ $title := "Unubscribe from all labels" }} 106 + {{ $title := "Unsubscribe from all labels" }} 107 107 {{ $icon := "x" }} 108 108 {{ $text := "unsubscribe all" }} 109 109 {{ $action := "unsubscribe" }}
+2 -2
appview/pulls/pulls.go
··· 1469 1469 } 1470 1470 1471 1471 if err := s.validator.ValidatePatch(&patch); err != nil { 1472 - s.logger.Error("faield to validate patch", "err", err) 1472 + s.logger.Error("failed to validate patch", "err", err) 1473 1473 s.pages.Notice(w, "patch-error", "Invalid patch format. Please provide a valid git diff or format-patch.") 1474 1474 return 1475 1475 } ··· 1983 1983 deletions := make(map[string]*models.Pull) 1984 1984 updated := make(map[string]struct{}) 1985 1985 1986 - // pulls in orignal stack but not in new one 1986 + // pulls in original stack but not in new one 1987 1987 for _, op := range origStack { 1988 1988 if _, ok := newById[op.ChangeId]; !ok { 1989 1989 deletions[op.ChangeId] = op
+1 -1
appview/repo/repo.go
··· 1073 1073 1074 1074 rkey := tid.TID() 1075 1075 1076 - // TODO: this could coordinate better with the knot to recieve a clone status 1076 + // TODO: this could coordinate better with the knot to receive a clone status 1077 1077 client, err := rp.oauth.ServiceClient( 1078 1078 r, 1079 1079 oauth.WithService(targetKnot),
+1 -1
appview/repo/settings.go
··· 631 631 }) 632 632 633 633 if err != nil { 634 - l.Error("failed to perferom update-repo query", "err", err) 634 + l.Error("failed to perform update-repo query", "err", err) 635 635 // failed to get record 636 636 rp.pages.Notice(w, noticeId, "Failed to save repository information, unable to save to PDS.") 637 637 return
+1 -1
blog/posts/6-months.md
··· 86 86 87 87 ## hosted PDS 88 88 89 - A complaint we often recieved was the need for a Bluesky account to use 89 + A complaint we often received was the need for a Bluesky account to use 90 90 Tangled; and besides, we realised that the overlap between Bluesky users 91 91 and possible Tangled users only goes so far -- we aim to be a generic 92 92 code forge after all, AT just happens to be an implementation
+1 -1
blog/posts/intro.md
··· 51 51 enables common workflows to work as you'd expect, all while remaining 52 52 decentralized. 53 53 54 - We believe that atproto has greatly simplfied one of the hardest parts 54 + We believe that atproto has greatly simplified one of the hardest parts 55 55 of social media: having your friends on it. Today, we're rolling out 56 56 invite-only access to Tangled -- join us on IRC at `#tangled` on 57 57 [libera.chat](https://libera.chat) and we'll get you set up.
+1 -1
blog/posts/seed.md
··· 36 36 building artisanal libraries, or one dev and a hundred agents building a 37 37 micro-SaaS. 38 38 39 - And finding the right investors to help us acheive this vision wasn't 39 + And finding the right investors to help us achieve this vision wasn't 40 40 something we took lightly. We spent months getting to know potential 41 41 partners -- among which, byFounders stood out immediately. Like us, 42 42 they're community-driven at their core, and their commitment to
+1 -1
docs/DOCS.md
··· 1657 1657 > 1658 1658 > to store the builder VM in a temporary dir. 1659 1659 > 1660 - > You should read and follow [all the other intructions][darwin builder vm] to 1660 + > You should read and follow [all the other instructions][darwin builder vm] to 1661 1661 > avoid subtle problems. 1662 1662 1663 1663 Alternatively, you can use any other method to set up a
+1 -1
flake.nix
··· 24 24 flake = false; 25 25 }; 26 26 htmx-ws-src = { 27 - # strange errors in consle that i can't really make out 27 + # strange errors in console that i can't really make out 28 28 # url = "https://unpkg.com/htmx.org@2.0.4/dist/ext/ws.js"; 29 29 url = "https://cdn.jsdelivr.net/npm/htmx-ext-ws@2.0.2"; 30 30 flake = false;
+1 -1
knotmirror/tapclient.go
··· 119 119 if evt.Action == tapc.RecordUpdateAction { 120 120 exist, err := t.gitm.Exist(repo) 121 121 if err != nil { 122 - return fmt.Errorf("checking git repo existance: %w", err) 122 + return fmt.Errorf("checking git repo existence: %w", err) 123 123 } 124 124 if exist { 125 125 // update git repo remote url
+1 -1
knotserver/git/merge.go
··· 233 233 func (g *GitRepo) applySingleMailbox(singlePatch types.FormatPatch) (plumbing.Hash, error) { 234 234 tmpPatch, err := createTemp(singlePatch.Raw) 235 235 if err != nil { 236 - return plumbing.ZeroHash, fmt.Errorf("failed to create temporary patch file for singluar mailbox patch: %w", err) 236 + return plumbing.ZeroHash, fmt.Errorf("failed to create temporary patch file for singular mailbox patch: %w", err) 237 237 } 238 238 239 239 var stderr bytes.Buffer
+1 -1
knotserver/xrpc/delete_branch.go
··· 68 68 } 69 69 70 70 if ok, err := x.Enforcer.IsPushAllowed(actorDid.String(), rbac.ThisServer, repoDid); !ok || err != nil { 71 - l.Error("insufficent permissions", "did", actorDid.String(), "repo", repoDid) 71 + l.Error("insufficient permissions", "did", actorDid.String(), "repo", repoDid) 72 72 writeError(w, xrpcerr.AccessControlError(actorDid.String()), http.StatusUnauthorized) 73 73 return 74 74 }
+1 -1
knotserver/xrpc/set_default_branch.go
··· 70 70 } 71 71 72 72 if ok, err := x.Enforcer.IsPushAllowed(actorDid.String(), rbac.ThisServer, repoDid); !ok || err != nil { 73 - l.Error("insufficent permissions", "did", actorDid.String()) 73 + l.Error("insufficient permissions", "did", actorDid.String()) 74 74 writeError(w, xrpcerr.AccessControlError(actorDid.String()), http.StatusUnauthorized) 75 75 return 76 76 }
+1 -1
nix/pkgs/appview-static-files.nix
··· 12 12 src, 13 13 }: 14 14 runCommandLocal "appview-static-files" { 15 - # TOOD(winter): figure out why this is even required after 15 + # TODO(winter): figure out why this is even required after 16 16 # changing the libraries that the tailwindcss binary loads 17 17 sandboxProfile = '' 18 18 (allow file-read* (subpath "/System/Library/OpenSSL"))
+1 -1
patchutil/interdiff.go
··· 288 288 // we have f1 and f2, calculate interdiff 289 289 interdiffFile = interdiffFiles(f1, f2) 290 290 } else { 291 - // only in patch 1, this change would have to be "inverted" to dissapear 291 + // only in patch 1, this change would have to be "inverted" to disappear 292 292 // from patch 2, so we reverseDiff(f1) 293 293 reverseDiff(f1) 294 294
+1 -1
patchutil/patchutil.go
··· 153 153 file.BinaryFragment, file.ReverseBinaryFragment = file.ReverseBinaryFragment, file.BinaryFragment 154 154 155 155 for _, fragment := range file.TextFragments { 156 - // swap postions 156 + // swap positions 157 157 fragment.OldPosition, fragment.NewPosition = fragment.NewPosition, fragment.OldPosition 158 158 fragment.OldLines, fragment.NewLines = fragment.NewLines, fragment.OldLines 159 159 fragment.LinesAdded, fragment.LinesDeleted = fragment.LinesDeleted, fragment.LinesAdded
+1 -1
sets/set_test.go
··· 240 240 } 241 241 } 242 242 243 - func TestPropertySingleonLen(t *testing.T) { 243 + func TestPropertySingletonLen(t *testing.T) { 244 244 f := func(item int) bool { 245 245 single := Singleton(item) 246 246 return single.Len() == 1
+1 -1
spindle/engine/engine.go
··· 85 85 if err != nil { 86 86 // TODO(winter): Should this always set StatusFailed? 87 87 // In the original, we only do in a subset of cases. 88 - l.Error("setting up worklow", "wid", wid, "err", err) 88 + l.Error("setting up workflow", "wid", wid, "err", err) 89 89 90 90 destroyErr := eng.DestroyWorkflow(ctx, wid) 91 91 if destroyErr != nil {
+1 -1
spindle/engines/nixery/engine.go
··· 245 245 Target: "/tmp", 246 246 ReadOnly: false, 247 247 TmpfsOptions: &mount.TmpfsOptions{ 248 - Mode: 0o1777, // world-writeable sticky bit 248 + Mode: 0o1777, // world-writable sticky bit 249 249 Options: [][]string{ 250 250 {"exec"}, 251 251 },
+1 -1
spindle/xrpc/add_secret.go
··· 69 69 } 70 70 71 71 if ok, err := x.Enforcer.IsSettingsAllowed(actorDid.String(), rbac.ThisServer, didPath); !ok || err != nil { 72 - l.Error("insufficent permissions", "did", actorDid.String()) 72 + l.Error("insufficient permissions", "did", actorDid.String()) 73 73 writeError(w, xrpcerr.AccessControlError(actorDid.String()), http.StatusUnauthorized) 74 74 return 75 75 }
+1 -1
spindle/xrpc/list_secrets.go
··· 64 64 } 65 65 66 66 if ok, err := x.Enforcer.IsSettingsAllowed(actorDid.String(), rbac.ThisServer, didPath); !ok || err != nil { 67 - l.Error("insufficent permissions", "did", actorDid.String()) 67 + l.Error("insufficient permissions", "did", actorDid.String()) 68 68 writeError(w, xrpcerr.AccessControlError(actorDid.String()), http.StatusUnauthorized) 69 69 return 70 70 }
+1 -1
spindle/xrpc/pipeline_cancel_pipeline.go
··· 80 80 return 81 81 } 82 82 for _, engine := range x.Engines { 83 - l.Debug("destorying workflow", "wid", wid) 83 + l.Debug("destroying workflow", "wid", wid) 84 84 err = engine.DestroyWorkflow(r.Context(), wid) 85 85 if err != nil { 86 86 fail(xrpcerr.GenericError(fmt.Errorf("failed to destroy workflow: %w", err)))
+1 -1
spindle/xrpc/remove_secret.go
··· 63 63 } 64 64 65 65 if ok, err := x.Enforcer.IsSettingsAllowed(actorDid.String(), rbac.ThisServer, didPath); !ok || err != nil { 66 - l.Error("insufficent permissions", "did", actorDid.String()) 66 + l.Error("insufficient permissions", "did", actorDid.String()) 67 67 writeError(w, xrpcerr.AccessControlError(actorDid.String()), http.StatusUnauthorized) 68 68 return 69 69 }
+2 -2
tapc/tap.go
··· 133 133 134 134 defer func() { 135 135 conn.Close() 136 - l.Warn("closed tap conection") 136 + l.Warn("closed tap connection") 137 137 }() 138 - l.Info("established tap conection") 138 + l.Info("established tap connection") 139 139 140 140 for { 141 141 select {
-21
types/repo.go
··· 1 1 package types 2 2 3 3 import ( 4 - "encoding/json" 5 - 6 4 "github.com/bluekeyes/go-gitdiff/gitdiff" 7 5 "github.com/go-git/go-git/v5/plumbing/object" 8 6 ) ··· 71 69 IsDefault bool `json:"is_default,omitempty"` 72 70 } 73 71 74 - func (b *Branch) UnmarshalJSON(data []byte) error { 75 - aux := &struct { 76 - Reference `json:"reference"` 77 - Commit *object.Commit `json:"commit,omitempty"` 78 - IsDefault bool `json:"is_default,omitempty"` 79 - MispelledIsDefault bool `json:"is_deafult,omitempty"` // mispelled name 80 - }{} 81 - 82 - if err := json.Unmarshal(data, aux); err != nil { 83 - return err 84 - } 85 - 86 - b.Reference = aux.Reference 87 - b.Commit = aux.Commit 88 - b.IsDefault = aux.IsDefault || aux.MispelledIsDefault // whichever was set 89 - 90 - return nil 91 - } 92 - 93 72 type RepoTagsResponse struct { 94 73 Tags []*TagReference `json:"tags,omitempty"` 95 74 }
+1 -1
xrpc/errors/errors.go
··· 90 90 var AccessControlError = func(d string) XrpcError { 91 91 return NewXrpcError( 92 92 WithTag("AccessControl"), 93 - WithError(fmt.Errorf("DID does not have sufficent access permissions for this operation: %s", d)), 93 + WithError(fmt.Errorf("DID does not have sufficient access permissions for this operation: %s", d)), 94 94 ) 95 95 } 96 96

History

1 round 2 comments
sign up or login to add to the discussion
eti.tf submitted #0
1 commit
expand
tangled: correct typos throughout codebase
expand 2 comments

types/repo.go why remove this method? It's used for some knot xrpc responses. We should replace it with proper lexicons (I'm working on it!) but not related to this PR.

everything else lgtm! Thanks!

yeah that might be my only concern as well, old knots would still return the old incorrect field. that being said, its atleast a few months old at this point, so im not opposed to dropping support for that field. knotmirror does support the corrected field name in any case.

pull request successfully merged