CI: add dupword linter and fix issues#6474
Merged
gmalouf merged 6 commits intoalgorand:masterfrom Oct 23, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds the "dupword" linter to enforce detection of duplicate words in code comments, inspired by external contributions. It addresses all identified duplicate word issues throughout the codebase by correcting comments and documentation that contained repeated words.
- Configures the dupword linter in
.golangci.ymlto check comments only, with an exception for "long long" - Fixes duplicate words in comments across 40+ files spanning utilities, network, ledger, data structures, and daemon components
- Updates the golangci-lint version to support the new linter
Reviewed Changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .golangci.yml | Adds dupword linter configuration with comments-only mode |
| scripts/buildtools/versions | Updates golangci-lint version to support dupword linter |
| util/rateLimit.go | Fixes "are are" → "are" in congestion manager comment |
| util/metrics/gauge_test.go | Fixes "the the" → "in the" in test comment |
| util/metrics/counter_test.go | Fixes three instances of "the the" → "the" in test comments |
| tools/network/resolver.go | Fixes "the the" → "the" in DNS resolver field comment |
| tools/network/dnssec/client.go | Fixes "and and" → "and" in QueryRRSet function comment |
| test/e2e-go/features/catchup/basicCatchup_test.go | Fixes "the the" → "that" in test function comment |
| shared/algoh/config.go | Fixes two instances of "the the" → "the" in Save and Dump function comments |
| rpcs/blockService_test.go | Combines two comment lines into one, removing duplicate "timestamp" |
| protocol/codec.go | Fixes "from from" → "from" in Decode function comment |
| node/node_test.go | Fixes "to to" → "to" in test comment |
| network/wsNetwork_test.go | Fixes "dropped dropped" → "dropped" in test comment |
| network/wsNetwork.go | Fixes "out of" → "out of" and removes redundant "and" in filterASCII comment |
| network/websocketProxy_test.go | Fixes "to to" → "to" in package comment |
| network/p2pNetwork.go | Fixes "from from" → "from" in GetPeers comment |
| network/netidentity_test.go | Fixes "not not" → "not" in test comment |
| network/hybridNetwork_test.go | Fixes "and and" → "and" in test comment |
| network/gossipNode.go | Fixes "be be" → "be" in MessageValidatorHandler interface comment |
| netdeploy/networkTemplate.go | Fixes "which is" → "which" in TemplateKMDConfig comment |
| logging/telemetry.go | Fixes "the the" → "the" in ReadTelemetryConfigOrDefault comment |
| logging/cyclicWriter.go | Fixes "the the" → "the" in Write function comment |
| ledger/store/trackerdb/testinterface.go | Fixes capitalization in package comment |
| ledger/store/trackerdb/generickv/migrations.go | Fixes "at at" → "at a" in migration comment |
| ledger/ledgercore/statedelta.go | Fixes "single single" → "single" in ModifiedCreatable comment |
| ledger/eval/txntracer_test.go | Improves comment clarity by replacing duplicate "addrs[1]" reference |
| ledger/catchupaccessor.go | Removes duplicate "TotalAccounts" in comment |
| ledger/catchpointtracker_test.go | Fixes "the the" → "the" in test comment |
| ledger/boxtxn_test.go | Fixes "the the" → "the" and "have have" → "have" in test comments |
| ledger/acctupdates_test.go | Fixes "creator creator" → "creator" in test comment |
| ledger/acctonline_test.go | Fixes "next next" → "next" in test comment |
| ledger/acctonline.go | Adds nolint:dupword directive for intentional duplicate "ver1" usage |
| ledger/acctdeltas_test.go | Fixes "and and" → "and" in test comment and adds nolint directive |
| data/transactions/logic/evalStateful_test.go | Fixes "it it" → "is" and "the the" → "the" in test comments |
| data/transactions/logic/eval.go | Fixes "with with" → "with" and "to to" → "to" in function comments |
| data/transactions/logic/assembler_test.go | Fixes "really really" → "really" in test comment |
| data/pools/transactionPool.go | Fixes "the the" → "the" in addToPendingBlockEvaluatorOnce comment |
| data/basics/userBalance.go | Fixes "is is" → "is" in AccountData field comment |
| data/appRateLimiter_test.go | Fixes "next next" → "next" in test comment |
| daemon/kmd/wallet/driver/sqlite_crypto.go | Fixes "the the" → "the" in extractKeyWithIndex comment |
| daemon/kmd/config/config.go | Fixes "the the" → "the" in LoadKMDConfig comment |
| daemon/kmd/api/v1/handlers.go | Fixes "in the" → "in" in errorResponse comment |
| daemon/algod/api/server/v1/routes/routes.go | Improves comment clarity by removing "v1" reference |
| config/localTemplate.go | Fixes "in in" → "in" in UseXForwardedForAddressField comment |
| agreement/state_machine_test.go | Fixes "test test" → "test" in deterministicTraceTestCase comment |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
jannotti
previously approved these changes
Oct 23, 2025
Co-authored-by: John Jannotti <jannotti@gmail.com>
jannotti
approved these changes
Oct 23, 2025
gmalouf
approved these changes
Oct 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Inspired by helpful open source contributions in #6463 and #6471 this adds the "dupword" linter and also fixes all the issues it found.
This will enforce new duplicate words don't creep into the codebase, obviating the need for future contributions like those in #6463 and #6471.
As a bonus, this PR also enables the misspell linter for test code (it was already running on non-test code) to pre-empt the need for typo PR fixes in the future.
Test Plan
Linter should pass