Skip to content

Commit

Permalink
Bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatthm committed Aug 18, 2022
1 parent 4fae830 commit fa775c1
Show file tree
Hide file tree
Showing 11 changed files with 132 additions and 29 deletions.
78 changes: 78 additions & 0 deletions .gherkin-lintrc
@@ -0,0 +1,78 @@
{
"file-name": [
"on",
{
"style": "PascalCase"
}
],
"no-files-without-scenarios": "on",
"no-unnamed-features": "on",
"no-unnamed-scenarios": "on",
"no-dupe-scenario-names": [
"on",
"in-feature"
],
"no-dupe-feature-names": "on",
"no-partially-commented-tag-lines": "on",
"indentation": [
"on",
{
"Feature": 0,
"Background": 4,
"Scenario": 4,
"Step": 8,
"Examples": 8,
"example": 12,
"given": 8,
"when": 8,
"then": 8,
"and": 8,
"but": 8,
"feature tag": 0,
"scenario tag": 4
}
],
"no-trailing-spaces": "on",
"new-line-at-eof": [
"on",
"yes"
],
"no-multiple-empty-lines": "on",
"no-empty-file": "on",
"no-scenario-outlines-without-examples": "on",
"name-length": [
"on",
{
"Feature": 150,
"Scenario": 150,
"Step": 150
}
],
"no-restricted-tags": [
"on",
{
"tags": [
"@dev",
"@watch",
"@wip"
]
}
],
"use-and": "on",
"no-duplicate-tags": "on",
"no-superfluous-tags": "on",
"no-homogenous-tags": "on",
"one-space-between-tags": "on",
"no-unused-variables": "on",
"no-background-only-scenario": "on",
"no-empty-background": "on",
"scenario-size": [
"on",
{
"steps-length": {
"Background": 15,
"Scenario": 15
}
}
]
}
Expand Up @@ -8,16 +8,22 @@ on:
- main
pull_request:
jobs:
golangci:
name: golangci-lint
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.19.x

- name: golangci-lint
uses: golangci/golangci-lint-action@v2.5.2
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.42.0
version: v1.48.0

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand All @@ -36,3 +42,9 @@ jobs:

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true

- name: gherkin-lint
uses: nhatthm/gherkin-lint-action@v1.0.0
with:
feature_files: features/*
config_file: .gherkin-lintrc
10 changes: 5 additions & 5 deletions .github/workflows/test.yaml
Expand Up @@ -8,27 +8,27 @@ on:

env:
GO111MODULE: "on"
GO_LATEST_VERSION: "1.17.x"
GO_LATEST_VERSION: "1.19.x"

jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
go-version: [ 1.16.x, 1.17.x ]
go-version: [ 1.17.x, 1.18.x, 1.19.x ]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Go cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
# In order:
# * Module download cache
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -11,6 +11,7 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out

bin
# Dependency directories (remove the comment below to include it)
/vendor

Expand Down
4 changes: 4 additions & 0 deletions .golangci.yaml
Expand Up @@ -21,6 +21,7 @@ linters:
enable-all: true
disable:
- exhaustivestruct
- exhaustruct
- forbidigo
- forcetypeassert
- gci
Expand All @@ -29,11 +30,14 @@ linters:
- gomnd
- ifshort
- interfacer
- ireturn
- lll
- maligned
- nolintlint # https://github.com/golangci/golangci-lint/issues/3063
- paralleltest
- scopelint
- testpackage
- varnamelen
- wrapcheck

issues:
Expand Down
14 changes: 11 additions & 3 deletions Makefile
@@ -1,7 +1,9 @@
VENDOR_DIR = vendor

GOLANGCI_LINT_VERSION ?= v1.48.0

GO ?= go
GOLANGCI_LINT ?= golangci-lint
GOLANGCI_LINT ?= golangci-lint-$(GOLANGCI_LINT_VERSION)

.PHONY: $(VENDOR_DIR) lint test test-unit

Expand All @@ -10,8 +12,9 @@ $(VENDOR_DIR):
@$(GO) mod vendor
@$(GO) mod tidy

lint:
@$(GOLANGCI_LINT) run
.PHONY: lint
lint: bin/$(GOLANGCI_LINT) $(VENDOR_DIR)
@bin/$(GOLANGCI_LINT) run -c .golangci.yaml

test: test-unit test-integration

Expand All @@ -23,3 +26,8 @@ test-unit:
test-integration:
@echo ">> integration test"
@$(GO) test ./features/... -gcflags=-l -coverprofile=features.coverprofile -coverpkg ./... -godog -race

bin/$(GOLANGCI_LINT):
@echo "$(OK_COLOR)==> Installing golangci-lint $(GOLANGCI_LINT_VERSION)$(NO_COLOR)"; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin "$(GOLANGCI_LINT_VERSION)"
@mv ./bin/golangci-lint bin/$(GOLANGCI_LINT)
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -6,7 +6,7 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/nhatthm/httpmock)](https://goreportcard.com/report/github.com/nhatthm/httpmock)
[![GoDevDoc](https://img.shields.io/badge/dev-doc-00ADD8?logo=go)](https://pkg.go.dev/github.com/godogx/clocksteps)

`clocksteps` uses [`nhatthm/go-clock`](https://github.com/nhatthm/go-clock) to provide steps for `cucumber/godog` and
`clocksteps` uses [`nhatthm/go-clock`](https://go.nhat.io/clock) to provide steps for `cucumber/godog` and
makes it easy to run tests with `time`.

## Prerequisites
Expand Down Expand Up @@ -47,7 +47,7 @@ func TestIntegration(t *testing.T) {
}
```

Read more about [`nhatthm/go-clock`](https://github.com/nhatthm/go-clock)
Read more about [`nhatthm/go-clock`](https://go.nhat.io/clock)

## Steps

Expand Down
2 changes: 1 addition & 1 deletion clock.go
Expand Up @@ -5,7 +5,7 @@ import (
"sync"
"time"

clock "github.com/nhatthm/go-clock"
"go.nhat.io/clock"
)

// ErrClockIsNotSet indicates that the clock must be set by either Clock.Set() or Clock.Freeze() before adding some
Expand Down
7 changes: 4 additions & 3 deletions features/bootstrap/godog_test.go
Expand Up @@ -4,17 +4,18 @@ import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
"strings"
"testing"
"time"

"github.com/cucumber/godog"
"github.com/godogx/clocksteps"
"github.com/nhatthm/timeparser"
"github.com/stretchr/testify/assert"

"github.com/godogx/clocksteps"
)

// Used by init().
Expand Down Expand Up @@ -62,7 +63,7 @@ func RunSuite(t *testing.T, path string, featureContext func(t *testing.T, ctx *

var paths []string

files, err := ioutil.ReadDir(filepath.Clean(path))
files, err := os.ReadDir(filepath.Clean(path))
assert.NoError(t, err)

paths = make([]string, 0, len(files))
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Expand Up @@ -4,18 +4,18 @@ go 1.17

require (
github.com/cucumber/godog v0.12.5
github.com/nhatthm/go-clock v0.6.0
github.com/nhatthm/timeparser v0.2.0
github.com/stretchr/testify v1.8.0
go.nhat.io/clock v0.7.0
)

require (
github.com/cucumber/gherkin-go/v19 v19.0.3 // indirect
github.com/cucumber/messages-go/v16 v16.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gofrs/uuid v4.0.0+incompatible // indirect
github.com/gofrs/uuid v4.2.0+incompatible // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-memdb v1.3.2 // indirect
github.com/hashicorp/go-memdb v1.3.3 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
Expand Down
13 changes: 6 additions & 7 deletions go.sum
Expand Up @@ -51,8 +51,9 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0=
github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
Expand Down Expand Up @@ -88,8 +89,8 @@ github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjh
github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-memdb v1.3.0/go.mod h1:Mluclgwib3R93Hk5fxEfiRhB+6Dar64wWh71LpNSe3g=
github.com/hashicorp/go-memdb v1.3.2 h1:RBKHOsnSszpU6vxq80LzC2BaQjuuvoyaQbkLTf7V7g8=
github.com/hashicorp/go-memdb v1.3.2/go.mod h1:Mluclgwib3R93Hk5fxEfiRhB+6Dar64wWh71LpNSe3g=
github.com/hashicorp/go-memdb v1.3.3 h1:oGfEWrFuxtIUF3W2q/Jzt6G85TrMk9ey6XfYLvVe1Wo=
github.com/hashicorp/go-memdb v1.3.3/go.mod h1:uBTr1oQbtuMgd1SSGoR8YV27eT3sBHbYiNm53bMpgSg=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
Expand Down Expand Up @@ -142,8 +143,6 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nhatthm/go-clock v0.6.0 h1:R8I8slcnValPDdM4Cd3Tk3JSSDnZk3nPuLzzPFInYtU=
github.com/nhatthm/go-clock v0.6.0/go.mod h1:KASu97ux5p0fpVsazI4sGJN+HlzeobKsvEtjaFQUXjc=
github.com/nhatthm/timeparser v0.2.0 h1:iItJSmsdRUMuEj/sTCcl1V1KT96TbuQ03uRpVDudodo=
github.com/nhatthm/timeparser v0.2.0/go.mod h1:FPeNpb70J+UHjmQifiImZWrDnc4Ao8dGdtZ08oaUdro=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
Expand Down Expand Up @@ -186,7 +185,6 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
Expand All @@ -198,6 +196,8 @@ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.nhat.io/clock v0.7.0 h1:L3t8s+bOqqMXlGcv2qgKhIHBFqYS7rB84gYOHl4F7iA=
go.nhat.io/clock v0.7.0/go.mod h1:95+ixhxejL/vGxvfiJnrEh19gr03GLyJcTZo7UDr6kA=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
Expand Down Expand Up @@ -319,7 +319,6 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down

0 comments on commit fa775c1

Please sign in to comment.