Skip to content

Commit

Permalink
chore: fix typos and comment formatting (#10653)
Browse files Browse the repository at this point in the history
* fix typos and comment formatting
  • Loading branch information
gammazero authored Jan 7, 2025
1 parent b7cc47a commit 7383e1e
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion config/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
22 changes: 11 additions & 11 deletions core/commands/cmdenv/cidbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions core/node/libp2p/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion docs/content-blocking.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/debug-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion docs/delegated-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion docs/file-transfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion test/cli/basic_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7383e1e

Please sign in to comment.