Skip to content

Commit 40b4b0f

Browse files
authored
Merge pull request #1643 from simonbaird/nvim-lsp-gopls-delint
Big format update from lsp/gopls via LazyVim
2 parents 0ce703d + 21c8e7e commit 40b4b0f

File tree

50 files changed

+136
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+136
-124
lines changed

acceptance/cli/cli.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ func setupSigs(ctx context.Context, vars map[string]string, environment []string
261261
if err := setVar(n, v); err != nil {
262262
return environment, vars, err
263263
}
264-
265264
}
266265

267266
return environment, vars, nil

acceptance/coverage/coverage.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ func parseMainGoFile(fset *token.FileSet, filePath string) (*ast.File, error) {
219219
// heurestics for resolving conflicts. Conflicts will have to be solved by a
220220
// human.
221221
func mergeASTTrees(fset *token.FileSet, t1 *ast.File, t2 *ast.File) (*bytes.Buffer, error) {
222-
223222
// Merge the imports from both files
224223
ast.Inspect(t1, func(n ast.Node) bool {
225224
switch x := n.(type) {
@@ -241,7 +240,6 @@ func mergeASTTrees(fset *token.FileSet, t1 *ast.File, t2 *ast.File) (*bytes.Buff
241240
}
242241
}
243242
return true
244-
245243
})
246244

247245
// Merge the declarations from t2 into t1

acceptance/kubernetes/kind/image.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func (k *kindCluster) buildCliImage(ctx context.Context) error {
5454
// only the task of a particular version. The image reference to the ec-cli
5555
// image is replaced with the image reference from buildCliImage.
5656
func (k *kindCluster) buildTaskBundleImage(ctx context.Context) error {
57-
5857
taskBundles := make(map[string][]string)
5958

6059
basePath := "tasks/"

acceptance/kubernetes/kind/kubernetes.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ func (k *kindCluster) createPolicyObject(ctx context.Context, specification stri
8181
},
8282
Spec: policySpec,
8383
}, nil
84-
8584
}
8685

8786
// createPolicy creates the EnterpriseContractPolicy custom resource in the test
@@ -127,7 +126,6 @@ func (k *kindCluster) createSnapshotObject(ctx context.Context, specification st
127126
},
128127
Spec: snapshotSpec,
129128
}, nil
130-
131129
}
132130

133131
// createSnapshot creates the Snapshot custom resource in the test

acceptance/kubernetes/kubernetes.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type startFunc func(context.Context) (context.Context, types.Cluster, error)
7777
// sure we don't start the cluster multiple times per Context is handled here
7878
func startAndSetupState(start startFunc) func(context.Context) (context.Context, error) {
7979
return func(ctx context.Context) (context.Context, error) {
80-
var c = &ClusterState{}
80+
c := &ClusterState{}
8181
ctx, err := testenv.SetupState(ctx, &c)
8282
if err != nil {
8383
return ctx, err
@@ -476,7 +476,6 @@ func AddStepsTo(sc *godog.ScenarioContext) {
476476

477477
return c.cluster.Stop(ctx)
478478
})
479-
480479
}
481480

482481
func InitializeSuite(ctx context.Context, tsc *godog.TestSuiteContext) {

acceptance/kubernetes/stub/stub.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ import (
3232
"github.com/enterprise-contract/ec-cli/acceptance/wiremock"
3333
)
3434

35-
type stubCluster struct {
36-
}
35+
type stubCluster struct{}
3736

3837
// stubApiserverRunning starts the stub apiserver using WireMock
3938
func Start(ctx context.Context) (context.Context, types.Cluster, error) {

acceptance/snaps/snaps.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ import (
3636
"github.com/enterprise-contract/ec-cli/acceptance/testenv"
3737
)
3838

39-
var timestampRegex = regexp.MustCompile(`\d\d[1-9]\d-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})?`) // generalized timestamp in not in 200x year
40-
var effectiveTimeRegex = regexp.MustCompile(`^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}?Z`) // generalized timestamp for any year
41-
var logTimestampRegex = regexp.MustCompile(`^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}`) // timestamp as it apears in the logs
42-
var tempPathRegex = regexp.MustCompile(`\$\{TEMP\}([^: \\"]+)[: ]?`) // starts with "${TEMP}" and ends with something not in path, perhaps breaks on Windows due to the colon
43-
var randomBitsRegex = regexp.MustCompile(`([a-f0-9]+)$`) // in general, we add random bits to paths as suffixes
44-
var unixTimestamp = regexp.MustCompile(`("| )(?:\d{10})(\\"|"|$)`) // Recent Unix timestamp in second resolution
39+
var (
40+
timestampRegex = regexp.MustCompile(`\d\d[1-9]\d-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})?`) // generalized timestamp in not in 200x year
41+
effectiveTimeRegex = regexp.MustCompile(`^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}?Z`) // generalized timestamp for any year
42+
logTimestampRegex = regexp.MustCompile(`^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}`) // timestamp as it apears in the logs
43+
tempPathRegex = regexp.MustCompile(`\$\{TEMP\}([^: \\"]+)[: ]?`) // starts with "${TEMP}" and ends with something not in path, perhaps breaks on Windows due to the colon
44+
randomBitsRegex = regexp.MustCompile(`([a-f0-9]+)$`) // in general, we add random bits to paths as suffixes
45+
unixTimestamp = regexp.MustCompile(`("| )(?:\d{10})(\\"|"|$)`) // Recent Unix timestamp in second resolution
46+
)
4547

4648
type errCapture struct {
4749
t *testing.T
@@ -142,7 +144,6 @@ func MatchSnapshot(ctx context.Context, qualifier, text string, vars map[string]
142144
}
143145

144146
wd, err := os.Getwd()
145-
146147
if err != nil {
147148
return err
148149
}

acceptance/testenv/testenv.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,16 @@ const (
4949
persistedFile = ".persisted"
5050
)
5151

52-
var loader = os.ReadFile
53-
var persister = os.WriteFile
52+
var (
53+
loader = os.ReadFile
54+
persister = os.WriteFile
55+
)
5456

55-
var version sync.Once
56-
var ecVersion = "undefined"
57-
var ecVersionErr error
57+
var (
58+
version sync.Once
59+
ecVersion = "undefined"
60+
ecVersionErr error
61+
)
5862

5963
// Persist persists the environment stored in context in a ".persisted" file as JSON
6064
func Persist(ctx context.Context) (bool, error) {

acceptance/wiremock/wiremock.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ const (
5050
// we re-expose functions from the wiremock package, add others
5151
// as needed
5252

53-
var Get = wiremock.Get
54-
var Post = wiremock.Post
55-
var URLPathEqualTo = wiremock.URLPathEqualTo
56-
var MatchingJsonPath = wiremock.MatchingJsonPath
57-
var NewResponse = wiremock.NewResponse
53+
var (
54+
Get = wiremock.Get
55+
Post = wiremock.Post
56+
URLPathEqualTo = wiremock.URLPathEqualTo
57+
MatchingJsonPath = wiremock.MatchingJsonPath
58+
NewResponse = wiremock.NewResponse
59+
)
5860

5961
type client struct {
6062
*wiremock.Client

cmd/inspect/inspect_policy_data.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ func inspectPolicyDataCmd() *cobra.Command {
135135

136136
return nil
137137
})
138-
139138
if err != nil {
140139
return err
141140
}

0 commit comments

Comments
 (0)