Skip to content

Commit

Permalink
Merge pull request #278 from vgarvardt/ci/spell-check
Browse files Browse the repository at this point in the history
ci: added spell check to the linter workflow and fixed reported issues
  • Loading branch information
vgarvardt authored Apr 4, 2024
2 parents 9e68f64 + 61de135 commit 728344e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = go.mod,go.sum,coverage.txt,.codespellrc,./vendor,./_example/outbox-worker-kafka/vendor,./.git,./.idea
check-hidden = true
11 changes: 10 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: "Lint"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
group: '${{ github.workflow }}-${{ github.head_ref }}'
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

on:
Expand Down Expand Up @@ -48,3 +48,12 @@ jobs:
only-new-issues: ${{ github.event_name == 'pull_request' }}
args: >
--config=./.github/linters/.golangci.yml
codespell:
name: Check spelling
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v4
- uses: codespell-project/actions-codespell@v2
13 changes: 13 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,16 @@ tasks:
sh: docker compose port postgres 5432
env:
TEST_POSTGRES: 'postgres://test:test@{{.PG_HOST}}/test?sslmode=disable'

spell-lint:
summary: Check spelling
vars:
CURDIR:
sh: pwd
cmds:
- cmd: |
docker run \
--interactive --tty --rm \
--volume "{{.CURDIR}}:/workdir" \
--workdir "/workdir" \
python:3.12-slim bash -c "python -m pip install --upgrade pip && pip install 'codespell>=2.2.4' && codespell"
2 changes: 1 addition & 1 deletion _example/outbox-worker-kafka/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func newClientCommand() *cobra.Command {

return &cobra.Command{
Use: "client",
Short: "Outbox Worker Client, enqueues messages to the gue for further processing by teh worker",
Short: "Outbox Worker Client, enqueues messages to the gue for further processing by the worker",
PreRunE: func(cmd *cobra.Command, args []string) (err error) {
gc, err = newGueClient(cmd.Context())
return
Expand Down
2 changes: 1 addition & 1 deletion backoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewExponentialBackoff(cfg exp.Config) Backoff {
return exp.Exponential{Config: cfg}.Backoff
}

// NewConstantBackoff instantiates new backoff implementation with teh constant retry duration that does not depend
// NewConstantBackoff instantiates new backoff implementation with the constant retry duration that does not depend
// on the retry.
func NewConstantBackoff(d time.Duration) Backoff {
return func(int) time.Duration {
Expand Down
2 changes: 1 addition & 1 deletion error.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var (
// ErrJobPanicked is returned when the job failed ot be handled because it is panicked.
// ErrJobPanicked is returned when the job failed to be handled because it is panicked.
// Error is normally returned wrapped, so use `errors.Is(err, gue.ErrJobPanicked)` to ensure this is the error you're
// looking for.
ErrJobPanicked = errors.New("job panicked")
Expand Down

0 comments on commit 728344e

Please sign in to comment.