Skip to content

Commit

Permalink
quick codespell pass over entire repo (#475)
Browse files Browse the repository at this point in the history
Hadn't run one of these in a while.
  • Loading branch information
bnewbold authored Dec 15, 2023
2 parents 705a15d + ffec62a commit e5eb11e
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions atproto/crypto/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type PrivateKey interface {
PublicKey() (PublicKey, error)

// Hashes the raw bytes using SHA-256, then signs the digest bytes.
// Always returns a "low-S" signature (for elliptic curve systems where that is ambigious).
// Always returns a "low-S" signature (for elliptic curve systems where that is ambiguous).
HashAndSign(content []byte) ([]byte, error)
}

Expand All @@ -37,7 +37,7 @@ type PrivateKeyExportable interface {
type PublicKey interface {
Equal(other PublicKey) bool

// Compact byte serialization (for elliptic curve systems where encoding is ambigious).
// Compact byte serialization (for elliptic curve systems where encoding is ambiguous).
Bytes() []byte

// Hashes the raw bytes using SHA-256, then verifies the signature of the digest bytes.
Expand All @@ -52,7 +52,7 @@ type PublicKey interface {
DIDKey() string

// Non-compact byte serialization (for elliptic curve systems where
// encoding is ambigious)
// encoding is ambiguous)
//
// This is not used frequently, or directly in atproto, but some
// serializations and encodings require it.
Expand Down
2 changes: 1 addition & 1 deletion atproto/identity/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func (i *Identity) PDSEndpoint() string {
return endpoint.URL
}

// Returns an atproto handle from the alsoKnownAs URI list for this identifier. Returns an error if there is no handle, or if an at:// URI failes to parse as a handle.
// Returns an atproto handle from the alsoKnownAs URI list for this identifier. Returns an error if there is no handle, or if an at:// URI fails to parse as a handle.
//
// Note that this handle is *not* necessarily to be trusted, as it may not have been bi-directionally verified. The 'Handle' field on the 'Identity' should contain either a verified handle, or the special 'handle.invalid' indicator value.
func (i *Identity) DeclaredHandle() (syntax.Handle, error) {
Expand Down
4 changes: 2 additions & 2 deletions atproto/syntax/datetime.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

const (
// Prefered atproto Datetime string syntax, for use with [time.Format].
// Preferred atproto Datetime string syntax, for use with [time.Format].
//
// Note that *parsing* syntax is more flexible.
AtprotoDatetimeLayout = "2006-01-02T15:04:05.999Z"
Expand Down Expand Up @@ -94,7 +94,7 @@ func (d Datetime) Time() time.Time {
return ret
}

// Creates a new valid Datetime string matching the current time, in prefered syntax.
// Creates a new valid Datetime string matching the current time, in preferred syntax.
func DatetimeNow() Datetime {
t := time.Now().UTC()
return Datetime(t.Format(AtprotoDatetimeLayout))
Expand Down
2 changes: 1 addition & 1 deletion atproto/syntax/uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"regexp"
)

// Represents an arbitary URI in string format, as would pass Lexicon syntax validation.
// Represents an arbitrary URI in string format, as would pass Lexicon syntax validation.
//
// The syntax is minimal and permissive, designed for fast verification and exact-string passthrough, not schema-specific parsing or validation. For example, will not validate AT-URI or DID strings.
//
Expand Down
4 changes: 2 additions & 2 deletions bgs/bgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1062,11 +1062,11 @@ func (s *BGS) createExternalUser(ctx context.Context, did string) (*models.Actor
// TODO: the case of handling a new user on a new PDS probably requires more thought
cfg, err := atproto.ServerDescribeServer(ctx, c)
if err != nil {
// TODO: failing this shouldnt halt our indexing
// TODO: failing this shouldn't halt our indexing
return nil, fmt.Errorf("failed to check unrecognized pds: %w", err)
}

// since handles can be anything, checking against this list doesnt matter...
// since handles can be anything, checking against this list doesn't matter...
_ = cfg

// TODO: could check other things, a valid response is good enough for now
Expand Down
6 changes: 3 additions & 3 deletions carstore/bs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ func (cs *CarStore) CompactUserShards(ctx context.Context, user models.Uid, skip
// Since we generally expect shards to start bigger and get smaller,
// and because we want to avoid compacting non-adjacent shards
// together, and because we want to avoid running a stat on every
// single shard (can be expensive for repos that havent been compacted
// single shard (can be expensive for repos that haven't been compacted
// in a while) we only skip a prefix of shard files that are over the
// threshold. this may end up not skipping some shards that are over
// the threshold if a below-threshold shard occurs before them, but
Expand Down Expand Up @@ -1375,7 +1375,7 @@ func (cs *CarStore) CompactUserShards(ctx context.Context, user models.Uid, skip

// we could also just add the duplicates to the keep set for now and
// focus on compacting everything else. it leaves *some* dirty blocks
// still around but we're doing that anyways since compaction isnt a
// still around but we're doing that anyways since compaction isn't a
// perfect process

log.Debugw("repo has dirty dupes", "count", len(dupes), "uid", user, "staleRefs", len(staleRefs), "blockRefs", len(brefs))
Expand Down Expand Up @@ -1527,7 +1527,7 @@ func (cs *CarStore) deleteStaleRefs(ctx context.Context, uid models.Uid, brefs [
return err
}

// now create a new staleRef with all the refs we couldnt clear out
// now create a new staleRef with all the refs we couldn't clear out
if len(staleToKeep) > 0 {
if err := txn.Create(&staleRef{
Usr: uid,
Expand Down
4 changes: 2 additions & 2 deletions carstore/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func checkRepo(t *testing.T, cs *CarStore, r io.Reader, expRecs []cid.Cid) {

if err := rep.ForEach(context.TODO(), "", func(k string, v cid.Cid) error {
if !set[v] {
return fmt.Errorf("have record we didnt expect")
return fmt.Errorf("have record we did not expect")
}

delete(set, v)
Expand All @@ -275,7 +275,7 @@ func checkRepo(t *testing.T, cs *CarStore, r io.Reader, expRecs []cid.Cid) {
fmt.Println("matched error")
bs, err := cs.ReadOnlySession(1)
if err != nil {
fmt.Println("couldnt read session: ", err)
fmt.Println("could not read session: ", err)
}

blk, err := bs.Get(context.TODO(), ierr.Cid)
Expand Down
2 changes: 1 addition & 1 deletion cmd/fakermaker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Then, from the top-level directory, run test commands:
# create posts, including mentions and image uploads
go run ./cmd/fakermaker/ gen-posts

# create more interations, such as likes, between accounts
# create more interactions, such as likes, between accounts
go run ./cmd/fakermaker/ gen-interactions

# lastly, read-only queries, including timelines, notifications, and post threads
Expand Down
2 changes: 1 addition & 1 deletion cmd/labelmaker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Then configure labelmaker with:

SQRL is a moderation system built around a declarative rule language,
application events, and cached counter values. It is the open source release of
Smyt, a moderation system aquired and used by Twitter many years ago. See the
Smyt, a moderation system acquired and used by Twitter many years ago. See the
SQRL docs for more: <https://sqrl-lang.github.io/sqrl/index.html>

A local SQRL moderation server can be queried by providing `--sqrl-url` (or the
Expand Down
4 changes: 2 additions & 2 deletions cmd/palomar/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Palomar

Palomar is a backend search service for atproto, specifically the `bsky.app` post and profile record types. It works by consuming a repo event stream ("firehose") and upating an OpenSearch cluster (fork of Elasticsearch) with docs.
Palomar is a backend search service for atproto, specifically the `bsky.app` post and profile record types. It works by consuming a repo event stream ("firehose") and updating an OpenSearch cluster (fork of Elasticsearch) with docs.

Almost all the code for this service is actually in the `search/` directory at the top of this repo.

In September 2023, this service was substantially re-written. It no longer stores records in a local database, returns only "skelton" results (list of ATURIs or DIDs) via the HTTP API, and defines index mappings.
In September 2023, this service was substantially re-written. It no longer stores records in a local database, returns only "skeleton" results (list of ATURIs or DIDs) via the HTTP API, and defines index mappings.


## Query String Syntax
Expand Down
4 changes: 2 additions & 2 deletions events/diskpersist.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (dp *DiskPersistence) resumeLog() error {
return dp.initLogFile()
}

// 0 for the mode is fine since thats only used if O_CREAT is passed
// 0 for the mode is fine since that is only used if O_CREAT is passed
fi, err := os.OpenFile(filepath.Join(dp.primaryDir, lfr.Path), os.O_RDWR, 0)
if err != nil {
return err
Expand Down Expand Up @@ -455,7 +455,7 @@ func (dp *DiskPersistence) doPersist(ctx context.Context, j persistJob) error {
e.RepoTombstone.Seq = seq
default:
// only those three get peristed right now
// we shouldnt actually ever get here...
// we should not actually ever get here...
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions fakedata/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ func GenFollowsAndMutes(xrpcc *xrpc.Client, catalog *AccountCatalog, acc *Accoun
var tgt *AccountContext

if maxFollows > len(catalog.Regulars) {
return fmt.Errorf("not enought regulars to pick maxFollowers from")
return fmt.Errorf("not enough regulars to pick maxFollowers from")
}
if maxMutes > len(catalog.Regulars) {
return fmt.Errorf("not enought regulars to pick maxMutes from")
return fmt.Errorf("not enough regulars to pick maxMutes from")
}

regCount := 0
Expand Down
4 changes: 2 additions & 2 deletions indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ func (ix *Indexer) handleRecordDeleteGraphFollow(ctx context.Context, evt *repom
}

if q.RowsAffected == 0 {
log.Warnw("attempted to delete follow we didnt have a record for", "user", evt.User, "rkey", op.Rkey)
log.Warnw("attempted to delete follow we did not have a record for", "user", evt.User, "rkey", op.Rkey)
return nil
}

Expand Down Expand Up @@ -622,7 +622,7 @@ func (ix *Indexer) handleRecordUpdate(ctx context.Context, evt *repomgr.RepoEven
newReply := rec.Reply != nil

if oldReply != newReply {
// the 'replyness' of the post was changed... thats weird
// the 'replyness' of the post was changed... that's weird
log.Errorf("need to properly handle case where reply-ness of posts is changed")
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion mst/mst_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func serializeNodeData(entries []nodeEntry) (*nodeData, error) {
leaf := entries[i]

if !leaf.isLeaf() {
return nil, fmt.Errorf("Not a valid node: two subtrees next to eachother (%d, %d)", i, len(entries))
return nil, fmt.Errorf("Not a valid node: two subtrees next to each other (%d, %d)", i, len(entries))
}
i++

Expand Down
4 changes: 2 additions & 2 deletions pds/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ func (s *Server) createExternalUser(ctx context.Context, did string) (*models.Ac
if peering.ID == 0 {
cfg, err := atproto.ServerDescribeServer(ctx, c)
if err != nil {
// TODO: failing this shouldnt halt our indexing
// TODO: failing this should not halt our indexing
return nil, fmt.Errorf("failed to check unrecognized pds: %w", err)
}

// since handles can be anything, checking against this list doesnt matter...
// since handles can be anything, checking against this list does not matter...
_ = cfg

// TODO: could check other things, a valid response is good enough for now
Expand Down
4 changes: 2 additions & 2 deletions testing/integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func TestBGSMultiPDS(t *testing.T) {

time.Sleep(time.Second)

// we expect the bgs to learn about posts that it didnt directly see from
// we expect the bgs to learn about posts that it did not directly see from
// repos its already partially scraped, as long as its seen *something* after the missing post
// this is the 'catchup' process
ctx := context.Background()
Expand Down Expand Up @@ -233,7 +233,7 @@ func TestBGSMultiGap(t *testing.T) {

time.Sleep(time.Second * 2)

// we expect the bgs to learn about posts that it didnt directly see from
// we expect the bgs to learn about posts that it did not directly see from
// repos its already partially scraped, as long as its seen *something* after the missing post
// this is the 'catchup' process
_, err = b1.bgs.Index.GetPost(ctx, p2posts2[4].Uri)
Expand Down

0 comments on commit e5eb11e

Please sign in to comment.