Skip to content

Commit 453fc8b

Browse files
lint fixes
1 parent 0155477 commit 453fc8b

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

pkg/tfgen/installation_docs.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package tfgen
22

33
import (
44
"fmt"
5+
"strings"
6+
57
"golang.org/x/text/cases"
68
"golang.org/x/text/language"
7-
"strings"
89
)
910

1011
func plainDocsParser(docFile *DocFile, g *Generator) ([]byte, error) {
@@ -42,7 +43,8 @@ func writeFrontMatter(title string) string {
4243
func writeIndexFrontMatter(displayName string) string {
4344
return fmt.Sprintf(delimiter+
4445
"title: %[1]s\n"+
45-
"meta_desc: The %[1]s provider for Pulumi can be used to provision any of the cloud resources available in %[1]s.\n"+
46+
"meta_desc: The %[1]s provider for Pulumi "+
47+
"can be used to provision any of the cloud resources available in %[1]s.\n"+
4648
"layout: package\n"+
4749
delimiter,
4850
displayName)
@@ -80,9 +82,9 @@ func writeInstallationInstructions(goImportBasePath, providerName string) string
8082
"## Installation\n\n"+
8183
"The %[1]s provider is available as a package in all Pulumi languages:\n\n"+
8284
"* JavaScript/TypeScript: [`@pulumi/%[1]s`](https://www.npmjs.com/package/@pulumi/%[1]s)\n"+
83-
"* Python: [`pulumi-%[1]s`](https://pypi.org/project/pulumi-%[1]s/)\n"+ //TODO: get the Go mod version somehow :blood_sob:
85+
"* Python: [`pulumi-%[1]s`](https://pypi.org/project/pulumi-%[1]s/)\n"+
8486
"* Go: [`%[3]s`](https://github.com/pulumi/pulumi-%[1]s)\n"+
85-
"* .NET: [`Pulumi.%[2]s`](https://www.nuget.org/packages/Pulumi.%[2]s)\n"+ //TODO: use capitalized
87+
"* .NET: [`Pulumi.%[2]s`](https://www.nuget.org/packages/Pulumi.%[2]s)\n"+
8688
"* Java: [`com.pulumi/%[1]s`](https://central.sonatype.com/artifact/com.pulumi/%[1]s)\n\n",
8789
providerName,
8890
cSharpName,

pkg/tfgen/installation_docs_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package tfgen
22

33
import (
4-
"github.com/stretchr/testify/require"
54
"testing"
5+
6+
"github.com/stretchr/testify/require"
67
)
78

9+
//nolint:lll
810
func TestPlainDocsParser(t *testing.T) {
911
t.Parallel()
1012

@@ -13,7 +15,6 @@ func TestPlainDocsParser(t *testing.T) {
1315
name string
1416
docFile DocFile
1517
expected []byte
16-
g *Generator
1718
}
1819

1920
tests := []testCase{
@@ -47,13 +48,13 @@ func TestPlainDocsParser(t *testing.T) {
4748
}
4849
}
4950

51+
//nolint:lll
5052
func TestWriteInstallationInstructions(t *testing.T) {
5153
t.Parallel()
5254

5355
type testCase struct {
5456
// The name of the test case.
5557
name string
56-
docFile DocFile
5758
goImportBasePath string
5859
packageName string
5960
expected string
@@ -65,9 +66,9 @@ func TestWriteInstallationInstructions(t *testing.T) {
6566
expected: "## Installation\n\n" +
6667
"The testcase provider is available as a package in all Pulumi languages:\n\n" +
6768
"* JavaScript/TypeScript: [`@pulumi/testcase`](https://www.npmjs.com/package/@pulumi/testcase)\n" +
68-
"* Python: [`pulumi-testcase`](https://pypi.org/project/pulumi-testcase/)\n" + //TODO: get the Go mod version somehow :blood_sob:
69+
"* Python: [`pulumi-testcase`](https://pypi.org/project/pulumi-testcase/)\n" +
6970
"* Go: [`github.com/pulumi/pulumi-testcase/sdk/v3/go/pulumi-testcase`](https://github.com/pulumi/pulumi-testcase)\n" +
70-
"* .NET: [`Pulumi.Testcase`](https://www.nuget.org/packages/Pulumi.Testcase)\n" + //TODO: use capitalized
71+
"* .NET: [`Pulumi.Testcase`](https://www.nuget.org/packages/Pulumi.Testcase)\n" +
7172
"* Java: [`com.pulumi/testcase`](https://central.sonatype.com/artifact/com.pulumi/testcase)\n\n",
7273
goImportBasePath: "github.com/pulumi/pulumi-testcase/sdk/v3/go/pulumi-testcase",
7374
packageName: "testcase",
@@ -76,7 +77,7 @@ func TestWriteInstallationInstructions(t *testing.T) {
7677
t.Run(tc.name, func(t *testing.T) {
7778
t.Parallel()
7879
actual := writeInstallationInstructions(tc.goImportBasePath, tc.packageName)
79-
require.Equal(t, string(tc.expected), actual)
80+
require.Equal(t, tc.expected, actual)
8081
})
8182
}
8283

@@ -86,7 +87,6 @@ func TestWriteFrontMatter(t *testing.T) {
8687
type testCase struct {
8788
// The name of the test case.
8889
name string
89-
docFile DocFile
9090
title string
9191
expected string
9292
}
@@ -115,7 +115,6 @@ func TestWriteIndexFrontMatter(t *testing.T) {
115115
type testCase struct {
116116
// The name of the test case.
117117
name string
118-
docFile DocFile
119118
displayName string
120119
expected string
121120
}
@@ -125,7 +124,8 @@ func TestWriteIndexFrontMatter(t *testing.T) {
125124
displayName: "Testcase",
126125
expected: delimiter +
127126
"title: Testcase\n" +
128-
"meta_desc: The Testcase provider for Pulumi can be used to provision any of the cloud resources available in Testcase.\n" +
127+
"meta_desc: The Testcase provider for Pulumi " +
128+
"can be used to provision any of the cloud resources available in Testcase.\n" +
129129
"layout: package\n" +
130130
delimiter,
131131
}

0 commit comments

Comments
 (0)