Skip to content

Commit b1501f4

Browse files
Vinay Shankar Shuklagithub-actions[bot]zabil
authored
Fix params type for step ref request. (#1858)
* Fix params type for step ref request. Signed-off-by: BugDiver <[email protected]> * Bump release version Signed-off-by: Zabil Cheriya Maliackal <[email protected]> * Upgrade golangci lint version Signed-off-by: Zabil Cheriya Maliackal <[email protected]> * Fix lint issues Signed-off-by: Zabil Cheriya Maliackal <[email protected]> * Add the right import statement Signed-off-by: Zabil Cheriya Maliackal <[email protected]> * Upgrade libraries Signed-off-by: Zabil Cheriya Maliackal <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Zabil Cheriya Maliackal <[email protected]>
1 parent df1f019 commit b1501f4

File tree

15 files changed

+26
-22
lines changed

15 files changed

+26
-22
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: golangci/golangci-lint-action@v2
1818
with:
1919
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
20-
version: v1.29
20+
version: v1.39
2121

2222
# Optional: working directory, useful for monorepos
2323
# working-directory: somedir
@@ -26,4 +26,4 @@ jobs:
2626
args: --disable=staticcheck
2727

2828
# Optional: show only new issues if it's a pull request. The default value is `false`.
29-
# only-new-issues: true
29+
# only-new-issues: true

api/lang/diagnostics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func validateConcepts(diagnostics map[lsp.DocumentURI][]lsp.Diagnostic) (*gauge.
127127
return nil, fmt.Errorf("unable to read file %s", err)
128128
}
129129
cpts, pRes := new(parser.ConceptParser).Parse(content, conceptFile)
130-
pErrs, err := parser.AddConcept(cpts, conceptFile, conceptDictionary)
130+
pErrs, err := parser.AddConcept(cpts, conceptFile, conceptDictionary) // nolint
131131
if err != nil {
132132
return nil, err
133133
}

api/lang/references.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import (
1717
)
1818

1919
func stepReferences(req *jsonrpc2.Request) (interface{}, error) {
20-
var params string
20+
var params []string
2121
if err := json.Unmarshal(*req.Params, &params); err != nil {
2222
return nil, fmt.Errorf("failed to parse request %v", err)
2323
}
24-
return getLocationFor(params)
24+
return getLocationFor(params[0])
2525
}
2626

2727
func stepValueAt(req *jsonrpc2.Request) (interface{}, error) {

api/lang/references_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Scenario Heading
3333
openFilesCache = &files{cache: make(map[lsp.DocumentURI][]string)}
3434
openFilesCache.add(uri, specText)
3535

36-
b, _ := json.Marshal("Say {} to {}")
36+
b, _ := json.Marshal([]string{"Say {} to {}"})
3737
params := json.RawMessage(b)
3838
want := []lsp.Location{
3939
{URI: uri, Range: lsp.Range{

cmd/run.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ import (
1010
"fmt"
1111
"os"
1212
"strconv"
13-
14-
"github.com/getgauge/gauge/gauge"
15-
1613
"strings"
17-
14+
gauge "github.com/getgauge/gauge/gauge"
1815
"github.com/getgauge/gauge/config"
1916
"github.com/getgauge/gauge/env"
2017
"github.com/getgauge/gauge/execution"

execution/merge.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ func mergeResults(results []*result.SpecResult) *result.SpecResult {
8181
if res.GetFailed() {
8282
specResult.IsFailed = true
8383
}
84-
var tableRows []*m.ProtoTableRow
84+
85+
var tableRows []*m.ProtoTableRow // nolint
86+
8587
for _, item := range res.ProtoSpec.Items {
8688
switch item.ItemType {
8789
case m.ProtoItem_Scenario:

execution/result/specResult.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (specResult *SpecResult) AddTableDrivenScenarioResult(r *ScenarioResult, t
5555
specResult.ScenarioFailedCount++
5656
}
5757
specResult.AddExecTime(r.ExecTime())
58-
pItem := &gauge_messages.ProtoItem{
58+
pItem := &gauge_messages.ProtoItem{ // nolint
5959
ItemType: gauge_messages.ProtoItem_TableDrivenScenario,
6060
TableDrivenScenario: &gauge_messages.ProtoTableDrivenScenario{
6161
Scenario: r.Item().(*gauge_messages.ProtoScenario),
@@ -88,7 +88,7 @@ func (specResult *SpecResult) AddTableRelatedScenarioResult(scenarioResults [][]
8888
TableRowIndex: int32(index),
8989
ScenarioTableRow: eachRow[scenarioIndex].(*ScenarioResult).ScenarioDataTableRow,
9090
}
91-
protoItem := &gauge_messages.ProtoItem{ItemType: gauge_messages.ProtoItem_TableDrivenScenario, TableDrivenScenario: protoTableDrivenScenario}
91+
protoItem := &gauge_messages.ProtoItem{ItemType: gauge_messages.ProtoItem_TableDrivenScenario, TableDrivenScenario: protoTableDrivenScenario} // nolint
9292
specResult.ProtoSpec.Items = append(specResult.ProtoSpec.Items, protoItem)
9393
}
9494
if scenarioFailed {

gauge/protoConverters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func ConvertToProtoTable(table *Table) *gauge_messages.ProtoTable {
154154
}
155155
protoTableParam := &gauge_messages.ProtoTable{Rows: make([]*gauge_messages.ProtoTableRow, 0)}
156156
protoTableParam.Headers = &gauge_messages.ProtoTableRow{Cells: table.Headers}
157-
for _, row := range table.Rows() {
157+
for _, row := range table.Rows() { // nolint
158158
protoTableParam.Rows = append(protoTableParam.Rows, &gauge_messages.ProtoTableRow{Cells: row})
159159
}
160160
return protoTableParam

go.sum

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
129129
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
130130
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
131131
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
132+
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
132133
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
133134
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
134135
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
@@ -150,6 +151,7 @@ github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP
150151
github.com/magiconair/properties v1.8.4 h1:8KGKTcQQGm0Kv7vEbKFErAoAOFyyacLStRtQSeYtvkY=
151152
github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
152153
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
154+
github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI=
153155
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
154156
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
155157
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
@@ -209,6 +211,7 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B
209211
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
210212
github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4=
211213
github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI=
214+
github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
212215
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
213216
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
214217
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
@@ -346,6 +349,7 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8
346349
google.golang.org/grpc v1.34.1 h1:ugq+9++ZQPFzM2pKUMCIK8gj9M0pFyuUWO9Q8kwEDQw=
347350
google.golang.org/grpc v1.34.1/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
348351
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
352+
google.golang.org/grpc v1.36.0 h1:o1bcQ6imQMIOpdrO3SWf2z5RV72WbDwdXuK0MDlc8As=
349353
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
350354
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
351355
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
@@ -373,6 +377,7 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
373377
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
374378
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
375379
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
380+
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
376381
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
377382
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
378383
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

logger/logger_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/getgauge/gauge/config"
1818
"github.com/getgauge/gauge/plugin/pluginInfo"
1919
"github.com/getgauge/gauge/version"
20-
"github.com/op/go-logging"
20+
logging "github.com/op/go-logging"
2121
)
2222

2323
func TestGetLoggerShouldGetTheLoggerForGivenModule(t *testing.T) {

0 commit comments

Comments
 (0)