From 7383e1ecbb41d91c3ac14e681d560c3a2702ebd2 Mon Sep 17 00:00:00 2001 From: Andrew Gillis <11790789+gammazero@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:17:39 -1000 Subject: [PATCH] chore: fix typos and comment formatting (#10653) * fix typos and comment formatting --- config/profile.go | 2 +- core/commands/cmdenv/cidbase.go | 22 +++++++++++----------- core/node/libp2p/routing.go | 8 ++++---- docs/content-blocking.md | 2 +- docs/debug-guide.md | 2 +- docs/delegated-routing.md | 2 +- docs/environment-variables.md | 2 +- docs/file-transfer.md | 2 +- test/cli/basic_commands_test.go | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/config/profile.go b/config/profile.go index 3a432963938..03e62172ae2 100644 --- a/config/profile.go +++ b/config/profile.go @@ -231,7 +231,7 @@ fetching may be degraded. USE WITH CAUTION: The main use case for this is setups with manual Peering.Peers config. Data from this node will not be announced on the DHT. This will make - DHT-based routing an data retrieval impossible if this node is the only + DHT-based routing and data retrieval impossible if this node is the only one hosting it, and other peers are not already connected to it. `, Transform: func(c *Config) error { diff --git a/core/commands/cmdenv/cidbase.go b/core/commands/cmdenv/cidbase.go index 55815f52427..926cd24a105 100644 --- a/core/commands/cmdenv/cidbase.go +++ b/core/commands/cmdenv/cidbase.go @@ -16,14 +16,14 @@ var ( ) // GetCidEncoder processes the `cid-base` and `output-cidv1` options and -// returns a encoder to use based on those parameters. +// returns an encoder to use based on those parameters. func GetCidEncoder(req *cmds.Request) (cidenc.Encoder, error) { return getCidBase(req, true) } -// GetLowLevelCidEncoder is like GetCidEncoder but meant to be used by -// lower level commands. It differs from GetCidEncoder in that CIDv0 -// are not, by default, auto-upgraded to CIDv1. +// GetLowLevelCidEncoder is like GetCidEncoder but meant to be used by lower +// level commands. It differs from GetCidEncoder in that CIDv0 are not, by +// default, auto-upgraded to CIDv1. func GetLowLevelCidEncoder(req *cmds.Request) (cidenc.Encoder, error) { return getCidBase(req, false) } @@ -52,19 +52,19 @@ func getCidBase(req *cmds.Request, autoUpgrade bool) (cidenc.Encoder, error) { return e, nil } -// CidBaseDefined returns true if the `cid-base` option is specified -// on the command line +// CidBaseDefined returns true if the `cid-base` option is specified on the +// command line func CidBaseDefined(req *cmds.Request) bool { base, _ := req.Options["cid-base"].(string) return base != "" } -// CidEncoderFromPath creates a new encoder that is influenced from -// the encoded Cid in a Path. For CidV0 the multibase from the base -// encoder is used and automatic upgrades are disabled. For CidV1 the -// multibase from the CID is used and upgrades are enabled. +// CidEncoderFromPath creates a new encoder that is influenced from the encoded +// Cid in a Path. For CIDv0 the multibase from the base encoder is used and +// automatic upgrades are disabled. For CIDv1 the multibase from the CID is +// used and upgrades are enabled. // -// This logic is intentionally fuzzy and will match anything of the form +// This logic is intentionally fuzzy and matches anything of the form // `CidLike`, `CidLike/...`, or `/namespace/CidLike/...`. // // For example: diff --git a/core/node/libp2p/routing.go b/core/node/libp2p/routing.go index 697bf0f2e6a..94c99e5dd4e 100644 --- a/core/node/libp2p/routing.go +++ b/core/node/libp2p/routing.go @@ -184,9 +184,8 @@ type p2pOnlineRoutingIn struct { Validator record.Validator } -// Routing will get all routers obtained from different methods -// (delegated routers, pub-sub, and so on) and add them all together -// using a TieredRouter. +// Routing will get all routers obtained from different methods (delegated +// routers, pub-sub, and so on) and add them all together using a TieredRouter. func Routing(in p2pOnlineRoutingIn) irouting.ProvideManyRouter { routers := in.Routers @@ -206,7 +205,8 @@ func Routing(in p2pOnlineRoutingIn) irouting.ProvideManyRouter { return routinghelpers.NewComposableParallel(cRouters) } -// OfflineRouting provides a special Router to the routers list when we are creating a offline node. +// OfflineRouting provides a special Router to the routers list when we are +// creating an offline node. func OfflineRouting(dstore ds.Datastore, validator record.Validator) p2pRouterOut { return p2pRouterOut{ Router: Router{ diff --git a/docs/content-blocking.md b/docs/content-blocking.md index fad63ad9ed3..e894868ace2 100644 --- a/docs/content-blocking.md +++ b/docs/content-blocking.md @@ -44,7 +44,7 @@ caused the request to be blocked. [NOpfs](https://github.com/ipfs-shipyard/nopfs) supports the format from [IPIP-383](https://github.com/ipfs/specs/pull/383). Clear-text rules are simple: just put content paths to block, one per line. -Paths with unicode and whitespace need to be percend-encoded: +Paths with unicode and whitespace need to be percent-encoded: ``` /ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR diff --git a/docs/debug-guide.md b/docs/debug-guide.md index 9ea8a3bb6f4..74034f41f54 100644 --- a/docs/debug-guide.md +++ b/docs/debug-guide.md @@ -106,6 +106,6 @@ See `tracing/doc.go` for more details. ### Other -If you have any questions, or want us to analyze some weird kubo behaviour, +If you have any questions, or want us to analyze some weird kubo behavior, just let us know, and be sure to include all the profiling information mentioned at the top. diff --git a/docs/delegated-routing.md b/docs/delegated-routing.md index 6f15972ed27..8f80beab671 100644 --- a/docs/delegated-routing.md +++ b/docs/delegated-routing.md @@ -338,7 +338,7 @@ As test fixtures we can add different use cases here and see how the configurati ~~We need to create a config migration using [fs-repo-migrations](https://github.com/ipfs/fs-repo-migrations). We should remove the `Routing.Type` param and add the configuration specified [previously](#Mimic-previous-dual-DHT-config).~~ -We don't need to create any config migration! To avoid to the users the hassle of understanding how the new routing system works, we are gonna keep the old behavior. We will add the Type `custom` to make available the new Routing system. +We don't need to create any config migration! To avoid to the users the hassle of understanding how the new routing system works, we are going to keep the old behavior. We will add the Type `custom` to make available the new Routing system. ### Security diff --git a/docs/environment-variables.md b/docs/environment-variables.md index f6832471f82..bbbc6662669 100644 --- a/docs/environment-variables.md +++ b/docs/environment-variables.md @@ -159,7 +159,7 @@ Default: `true` ## `LIBP2P_TCP_MUX` -By default Kubo tries to reuse the same listener port for raw TCP and WebSockers transports via experimental `libp2p.ShareTCPListener()` feature introduced in [go-libp2p#2984](https://github.com/libp2p/go-libp2p/pull/2984). +By default Kubo tries to reuse the same listener port for raw TCP and WebSockets transports via experimental `libp2p.ShareTCPListener()` feature introduced in [go-libp2p#2984](https://github.com/libp2p/go-libp2p/pull/2984). If this is an issue, you can disable it by setting `LIBP2P_TCP_MUX` to `false` and use separate ports for each TCP transport. > [!CAUTION] diff --git a/docs/file-transfer.md b/docs/file-transfer.md index e61ddc1b334..94d809768d3 100644 --- a/docs/file-transfer.md +++ b/docs/file-transfer.md @@ -36,7 +36,7 @@ doesn't even know it has to connect to node A. ### Checking for existing connections -The first thing to do is to double check that both nodes are in fact running +The first thing to do is to double-check that both nodes are in fact running and online. To do this, run `ipfs id` on each machine. If both nodes show some addresses (like the example below), then your nodes are online. diff --git a/test/cli/basic_commands_test.go b/test/cli/basic_commands_test.go index 603a03d9dea..a91340f9ae5 100644 --- a/test/cli/basic_commands_test.go +++ b/test/cli/basic_commands_test.go @@ -112,7 +112,7 @@ func TestAllRootCommandsAreMentionedInHelpText(t *testing.T) { // a few base commands are not expected to be in the help message // but we default to requiring them to be in the help message, so that we - // have to make an conscious decision to exclude them + // have to make a conscious decision to exclude them notInHelp := map[string]bool{ "object": true, "shutdown": true,