Skip to content

Commit

Permalink
chore: add dupword CI && remove repetitive words globally (celestiaor…
Browse files Browse the repository at this point in the history
…g#3360)

<!--
Thank you for submitting a pull request!

Please make sure you have reviewed our contributors guide before
submitting your
first PR.

Please ensure you've addressed or included references to any related
issues.

Tips:
- Use keywords like "closes" or "fixes" followed by an issue number to
automatically close related issues when the PR is merged (e.g., "closes
#123" or "fixes #123").
- Describe the changes made in the PR.
- Ensure the PR has one of the required tags (kind:fix, kind:misc,
kind:break!, kind:refactor, kind:feat, kind:deps, kind:docs, kind:ci,
kind:chore, kind:testing)

-->
use https://github.com/Abirdcfly/dupword to check duplicate words

output:
```
celestia-node/share/eds/retriever_quadrant.go:71:4: Duplicate words (into) found
celestia-node/share/availability/full/reconstruction_test.go:179:2: Duplicate words (L) found
celestia-node/share/getters/getter_test.go:338:2: Duplicate words (D) found
celestia-node/share/p2p/peers/manager_test.go:86:3: Duplicate words (be) found
```
  • Loading branch information
goofylfg authored May 9, 2024
1 parent 7f5cf06 commit a95003e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ linters:
- whitespace
- nolintlint
- asciicheck
- dupword

issues:
exclude-rules:
Expand Down
2 changes: 2 additions & 0 deletions share/availability/full/reconstruction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ func TestShareAvailable_ConnectedFullNodes(t *testing.T) {
// connected to isolated light nodes subnetworks, which do not have enough nodes
// to reconstruct the data, but once ShareAvailability nodes connect, they can
// collectively reconstruct it.
//
//nolint:dupword
func TestShareAvailable_DisconnectedFullNodes(t *testing.T) {
// S - Source
// L - Light Node
Expand Down
2 changes: 1 addition & 1 deletion share/eds/retriever_quadrant.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func newQuadrants(dah *da.DataAvailabilityHeader) []*quadrant {
}

for i := range quadrants {
// convert quadrant 1D into into 2D coordinates
// convert quadrant 1D into 2D coordinates
x, y := i%2, i/2
quadrants[i] = &quadrant{
roots: roots[qsize*y : qsize*(y+1)],
Expand Down
2 changes: 2 additions & 0 deletions share/getters/getter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ func randomEDS(t *testing.T) (*rsmt2d.ExtendedDataSquare, *header.ExtendedHeader

// randomEDSWithDoubledNamespace generates a random EDS and ensures that there are two shares in the
// middle that share a namespace.
//
//nolint:dupword
func randomEDSWithDoubledNamespace(
t *testing.T,
size int,
Expand Down
2 changes: 1 addition & 1 deletion share/p2p/peers/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestManager(t *testing.T) {
manager, err := testManager(ctx, headerSub)
require.NoError(t, err)

// own messages should be be accepted
// own messages should be accepted
msg := newShrexSubMsg(h)
result := manager.Validate(ctx, manager.host.ID(), msg)
require.Equal(t, pubsub.ValidationAccept, result)
Expand Down

0 comments on commit a95003e

Please sign in to comment.