Skip to content

Commit

Permalink
ci: add misspell action (#18671)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Dec 11, 2023
1 parent 978fffc commit 8cfdabb
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/.misspell-fixer.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
\*.pulsar.go
\*.pb.go
\*.pb.gw.go
\*.cosmos_orm.go
24 changes: 24 additions & 0 deletions .github/workflows/misspell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Fix typos nightly

on:
schedule:
- cron: "0 8 * * *"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: sobolevn/misspell-fixer-action@e5368f1b21585248afad4d32df9bc100451dbbff
- uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.PRBOT_PAT }}
commit-message: "chore: fixes by misspell-fixer"
title: "chore: typos fix by misspell-fixer"
branch: "bot/fix-typos"
delete-branch: true
body: |
This PR fixes typos in the codebase.
Please, review it and merge if everything is fine.
If there is proto changes, please, run `make proto-gen` and commit changes.
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ contributors, the general procedure for contributing has been established:
to begin work.
5. To submit your work as a contribution to the repository follow standard GitHub best practices. See [pull request guideline](#pull-requests) below.

**Note:** For very small or blatantly obvious problems such as typos, you are
**Note:** For very small or blatantly obvious problems, you are
not required to an open issue to submit a PR, but be aware that for more complex
problems/features, if a PR is opened before an adequate design discussion has
taken place in a GitHub issue, that PR runs a high likelihood of being rejected.

**Note 2:** At this time, we will not be accepting contributions that only fix spelling
or grammar errors in documentation, code or elsewhere. The repository has a nightly job that
spell checks all files and will automatically open PRs for any spelling errors.

## Teams Dev Calls

The Cosmos SDK has many stakeholders contributing and shaping the project. The Core SDK team is composed of Interchain GmbH and Regen Network Development developers. Any long-term contributors and additional maintainers from other projects are welcome. We use self-organizing principles to coordinate and collaborate across organizations in structured "EPIC" that focus on specific problem domains or architectural components of the Cosmos SDK.
Expand Down
6 changes: 3 additions & 3 deletions x/staking/keeper/delegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,16 +459,16 @@ func (k Keeper) GetRedelegationsFromSrcValidator(ctx context.Context, valAddr sd
// HasReceivingRedelegation checks if validator is receiving a redelegation.
func (k Keeper) HasReceivingRedelegation(ctx context.Context, delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) (bool, error) {
rng := collections.NewSuperPrefixedTripleRange[[]byte, []byte, []byte](valDstAddr, delAddr)
hasAtleastOneEntry := false
hasReceivingRedelegation := false
err := k.RedelegationsByValDst.Walk(ctx, rng, func(key collections.Triple[[]byte, []byte, []byte], value []byte) (stop bool, err error) {
hasAtleastOneEntry = true
hasReceivingRedelegation = true
return true, nil // returning true here to stop the iterations after 1st finding
})
if err != nil {
return false, err
}

return hasAtleastOneEntry, nil
return hasReceivingRedelegation, nil
}

// HasMaxRedelegationEntries checks if the redelegation entries reached maximum limit.
Expand Down

0 comments on commit 8cfdabb

Please sign in to comment.