ci: add misspell action (#18671)

This commit is contained in:
Julien Robert 2023-12-11 07:11:03 +01:00 committed by GitHub
parent 978fffc5a6
commit 8cfdabb2ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 4 deletions

4
.github/.misspell-fixer.ignore vendored Normal file
View File

@ -0,0 +1,4 @@
\*.pulsar.go
\*.pb.go
\*.pb.gw.go
\*.cosmos_orm.go

24
.github/workflows/misspell.yml vendored Normal file
View File

@ -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.

View File

@ -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.

View File

@ -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.