From 1fd30ce10cbd86cdf101027ef0c0d41bbf0fdba9 Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Tue, 24 Jan 2023 13:45:47 -0500 Subject: [PATCH 1/8] ci: add `golangci` linting + fixed deprecations --- .github/workflows/test.yml | 4 ++ .golangci.yml | 25 +++++++++ internal/cmd/generate.go | 2 +- internal/cmd/validate.go | 2 +- internal/mdplain/renderer.go | 37 ++++--------- internal/provider/generate.go | 11 ++-- internal/provider/template_test.go | 2 + internal/provider/util.go | 5 +- internal/provider/util_test.go | 6 +++ internal/tmplfuncs/tmplfuncs.go | 3 +- schemamd/behaviors_test.go | 30 +++++++++++ schemamd/render.go | 52 ++++++++++--------- schemamd/render_test.go | 5 ++ schemamd/write_attribute_description_test.go | 5 ++ schemamd/write_block_type_description_test.go | 5 ++ ..._nested_attribute_type_description_test.go | 5 ++ schemamd/write_type_test.go | 5 ++ 17 files changed, 138 insertions(+), 66 deletions(-) create mode 100644 .golangci.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5e7e603e..4f39b60b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,6 +19,10 @@ jobs: uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 with: go-version-file: 'go.mod' + - name: Run linters + uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0 + with: + version: latest - name: go vet run: go vet ./... - name: Run tests diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..560707ab --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,25 @@ +issues: + max-per-linter: 0 + max-same-issues: 0 + +linters: + disable-all: true + enable: + - durationcheck + - errcheck + - exportloopref + - forcetypeassert + - gofmt + - gosimple + - ineffassign + - makezero + - misspell + - nilerr + - paralleltest + - predeclared + - staticcheck + - tenv + - unconvert + - unparam + - unused + - vet \ No newline at end of file diff --git a/internal/cmd/generate.go b/internal/cmd/generate.go index 54e4d201..e41780b2 100644 --- a/internal/cmd/generate.go +++ b/internal/cmd/generate.go @@ -42,7 +42,7 @@ func (cmd *generateCmd) Help() string { } }) - strBuilder.WriteString(fmt.Sprintf("\nUsage: tfplugindocs generate []\n\n")) + strBuilder.WriteString("\nUsage: tfplugindocs generate []\n\n") cmd.Flags().VisitAll(func(f *flag.Flag) { if f.DefValue != "" { strBuilder.WriteString(fmt.Sprintf(" --%s %s%s%s (default: %q)\n", diff --git a/internal/cmd/validate.go b/internal/cmd/validate.go index 0f54c566..890ef8d1 100644 --- a/internal/cmd/validate.go +++ b/internal/cmd/validate.go @@ -30,7 +30,7 @@ func (cmd *validateCmd) Help() string { } }) - strBuilder.WriteString(fmt.Sprintf("\nUsage: tfplugindocs validate []\n\n")) + strBuilder.WriteString("\nUsage: tfplugindocs validate []\n\n") cmd.Flags().VisitAll(func(f *flag.Flag) { if f.DefValue != "" { strBuilder.WriteString(fmt.Sprintf(" --%s %s%s%s (default: %q)\n", diff --git a/internal/mdplain/renderer.go b/internal/mdplain/renderer.go index 6dd958e6..143e20f4 100644 --- a/internal/mdplain/renderer.go +++ b/internal/mdplain/renderer.go @@ -130,13 +130,9 @@ func (options *Text) Emphasis(out *bytes.Buffer, text []byte) { out.Write(text) } -func (options *Text) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) { - return -} +func (options *Text) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {} -func (options *Text) LineBreak(out *bytes.Buffer) { - return -} +func (options *Text) LineBreak(out *bytes.Buffer) {} func (options *Text) Link(out *bytes.Buffer, link []byte, title []byte, content []byte) { out.Write(content) @@ -144,12 +140,9 @@ func (options *Text) Link(out *bytes.Buffer, link []byte, title []byte, content out.WriteString(" ") out.Write(link) } - return } -func (options *Text) RawHtmlTag(out *bytes.Buffer, text []byte) { - return -} +func (options *Text) RawHtmlTag(out *bytes.Buffer, text []byte) {} func (options *Text) TripleEmphasis(out *bytes.Buffer, text []byte) { out.Write(text) @@ -159,9 +152,7 @@ func (options *Text) StrikeThrough(out *bytes.Buffer, text []byte) { out.Write(text) } -func (options *Text) FootnoteRef(out *bytes.Buffer, ref []byte, id int) { - return -} +func (options *Text) FootnoteRef(out *bytes.Buffer, ref []byte, id int) {} func (options *Text) Entity(out *bytes.Buffer, entity []byte) { out.Write(entity) @@ -171,25 +162,15 @@ func (options *Text) NormalText(out *bytes.Buffer, text []byte) { out.Write(text) } -func (options *Text) Smartypants(out *bytes.Buffer, text []byte) { - return -} +func (options *Text) Smartypants(out *bytes.Buffer, text []byte) {} -func (options *Text) DocumentHeader(out *bytes.Buffer) { - return -} +func (options *Text) DocumentHeader(out *bytes.Buffer) {} -func (options *Text) DocumentFooter(out *bytes.Buffer) { - return -} +func (options *Text) DocumentFooter(out *bytes.Buffer) {} -func (options *Text) TocHeader(text []byte, level int) { - return -} +func (options *Text) TocHeader(text []byte, level int) {} -func (options *Text) TocFinalize() { - return -} +func (options *Text) TocFinalize() {} func doubleSpace(out *bytes.Buffer) { if out.Len() > 0 { diff --git a/internal/provider/generate.go b/internal/provider/generate.go index ce5a4b13..41dc5e96 100644 --- a/internal/provider/generate.go +++ b/internal/provider/generate.go @@ -3,7 +3,6 @@ package provider import ( "context" "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -128,7 +127,7 @@ func (g *generator) Generate(ctx context.Context) error { switch { case g.websiteTmpDir == "": - g.websiteTmpDir, err = ioutil.TempDir("", "tfws") + g.websiteTmpDir, err = os.MkdirTemp("", "tfws") if err != nil { return err } @@ -249,7 +248,7 @@ func (g *generator) renderMissingResourceDoc(providerName, name, typeName string fallbackTmplPath = filepath.Join(g.websiteTmpDir, g.websiteSourceDir, fallbackTmplPath) if fileExists(fallbackTmplPath) { g.infof("resource %q fallback template exists", name) - tmplData, err := ioutil.ReadFile(fallbackTmplPath) + tmplData, err := os.ReadFile(fallbackTmplPath) if err != nil { return fmt.Errorf("unable to read file %q: %w", fallbackTmplPath, err) } @@ -377,7 +376,7 @@ func (g *generator) renderStaticWebsite(providerName string, providerSchema *tfj g.infof("rendering templated website to static markdown") - err = filepath.Walk(g.websiteTmpDir, func(path string, info os.FileInfo, err error) error { + err = filepath.Walk(g.websiteTmpDir, func(path string, info os.FileInfo, _ error) error { if info.IsDir() { // skip directories return nil @@ -410,7 +409,7 @@ func (g *generator) renderStaticWebsite(providerName string, providerSchema *tfj renderedPath = strings.TrimSuffix(renderedPath, ext) - tmplData, err := ioutil.ReadFile(path) + tmplData, err := os.ReadFile(path) if err != nil { return fmt.Errorf("unable to read file %q: %w", rel, err) } @@ -492,7 +491,7 @@ func (g *generator) terraformProviderSchema(ctx context.Context, providerName st shortName := providerShortName(providerName) - tmpDir, err := ioutil.TempDir("", "tfws") + tmpDir, err := os.MkdirTemp("", "tfws") if err != nil { return nil, err } diff --git a/internal/provider/template_test.go b/internal/provider/template_test.go index a55fb968..d69f495d 100644 --- a/internal/provider/template_test.go +++ b/internal/provider/template_test.go @@ -7,6 +7,8 @@ import ( ) func TestRenderStringTemplate(t *testing.T) { + t.Parallel() + template := ` Plainmarkdown: {{ plainmarkdown .Text }} Split: {{ $arr := split .Text " "}}{{ index $arr 3 }} diff --git a/internal/provider/util.go b/internal/provider/util.go index 1de2ed46..00c1e763 100644 --- a/internal/provider/util.go +++ b/internal/provider/util.go @@ -3,7 +3,6 @@ package provider import ( "fmt" "io" - "io/ioutil" "log" "os" "os/exec" @@ -78,7 +77,7 @@ func writeFile(path string, data string) error { return fmt.Errorf("unable to make dir %q: %w", dir, err) } - err = ioutil.WriteFile(path, []byte(data), 0644) + err = os.WriteFile(path, []byte(data), 0644) if err != nil { return fmt.Errorf("unable to write file %q: %w", path, err) } @@ -90,7 +89,7 @@ func runCmd(cmd *exec.Cmd) ([]byte, error) { output, err := cmd.CombinedOutput() if err != nil { log.Printf("error executing %q, %v", cmd.Path, cmd.Args) - log.Printf(string(output)) + log.Print(string(output)) return nil, fmt.Errorf("error executing %q: %w", cmd.Path, err) } return output, nil diff --git a/internal/provider/util_test.go b/internal/provider/util_test.go index 468c3231..3cbc923a 100644 --- a/internal/provider/util_test.go +++ b/internal/provider/util_test.go @@ -8,6 +8,8 @@ import ( ) func Test_resourceSchema(t *testing.T) { + t.Parallel() + cases := map[string]struct { schemas map[string]*tfjson.Schema providerShortName string @@ -63,7 +65,11 @@ func Test_resourceSchema(t *testing.T) { } for name, c := range cases { + name := name + c := c t.Run(name, func(t *testing.T) { + t.Parallel() + actualSchema, actualResourceName := resourceSchema(c.schemas, c.providerShortName, c.templateFileName) if !cmp.Equal(c.expectedSchema, actualSchema) { diff --git a/internal/tmplfuncs/tmplfuncs.go b/internal/tmplfuncs/tmplfuncs.go index 67ffa8f3..99d28f37 100644 --- a/internal/tmplfuncs/tmplfuncs.go +++ b/internal/tmplfuncs/tmplfuncs.go @@ -2,7 +2,6 @@ package tmplfuncs import ( "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -21,7 +20,7 @@ func CodeFile(format, file string) (string, error) { } fullPath := filepath.Join(wd, file) - content, err := ioutil.ReadFile(fullPath) + content, err := os.ReadFile(fullPath) if err != nil { return "", fmt.Errorf("unable to read content from %q: %w", file, err) } diff --git a/schemamd/behaviors_test.go b/schemamd/behaviors_test.go index 3bdb087f..44ed4d39 100644 --- a/schemamd/behaviors_test.go +++ b/schemamd/behaviors_test.go @@ -9,6 +9,8 @@ import ( ) func TestChildAttributeIsRequired(t *testing.T) { + t.Parallel() + for _, c := range []struct { name string att *tfjson.SchemaAttribute @@ -33,7 +35,10 @@ func TestChildAttributeIsRequired(t *testing.T) { false, }, } { + c := c t.Run(c.name, func(t *testing.T) { + t.Parallel() + actual := childAttributeIsRequired(c.att) if diff := cmp.Diff(c.expected, actual); diff != "" { t.Fatalf("Unexpected diff (-wanted, +got): %s", diff) @@ -43,6 +48,8 @@ func TestChildAttributeIsRequired(t *testing.T) { } func TestChildAttributeIsOptional(t *testing.T) { + t.Parallel() + for _, c := range []struct { name string att *tfjson.SchemaAttribute @@ -67,7 +74,10 @@ func TestChildAttributeIsOptional(t *testing.T) { true, }, } { + c := c t.Run(c.name, func(t *testing.T) { + t.Parallel() + actual := childAttributeIsOptional(c.att) if diff := cmp.Diff(c.expected, actual); diff != "" { t.Fatalf("Unexpected diff (-wanted, +got): %s", diff) @@ -77,6 +87,8 @@ func TestChildAttributeIsOptional(t *testing.T) { } func TestChildAttributeIsReadOnly(t *testing.T) { + t.Parallel() + for _, c := range []struct { name string att *tfjson.SchemaAttribute @@ -119,7 +131,10 @@ func TestChildAttributeIsReadOnly(t *testing.T) { true, }, } { + c := c t.Run(c.name, func(t *testing.T) { + t.Parallel() + actual := childAttributeIsReadOnly(c.att) if diff := cmp.Diff(c.expected, actual); diff != "" { t.Fatalf("Unexpected diff (-wanted, +got): %s", diff) @@ -129,6 +144,8 @@ func TestChildAttributeIsReadOnly(t *testing.T) { } func TestChildBlockIsRequired(t *testing.T) { + t.Parallel() + for _, c := range []struct { name string block *tfjson.SchemaBlockType @@ -170,7 +187,10 @@ func TestChildBlockIsRequired(t *testing.T) { false, }, } { + c := c t.Run(c.name, func(t *testing.T) { + t.Parallel() + actual := childBlockIsRequired(c.block) if diff := cmp.Diff(c.expected, actual); diff != "" { t.Fatalf("Unexpected diff (-wanted, +got): %s", diff) @@ -180,6 +200,8 @@ func TestChildBlockIsRequired(t *testing.T) { } func TestChildBlockIsOptional(t *testing.T) { + t.Parallel() + for _, c := range []struct { name string block *tfjson.SchemaBlockType @@ -335,7 +357,10 @@ func TestChildBlockIsOptional(t *testing.T) { true, }, } { + c := c t.Run(c.name, func(t *testing.T) { + t.Parallel() + actual := childBlockIsOptional(c.block) if diff := cmp.Diff(c.expected, actual); diff != "" { t.Fatalf("Unexpected diff (-wanted, +got): %s", diff) @@ -345,6 +370,8 @@ func TestChildBlockIsOptional(t *testing.T) { } func TestChildBlockIsReadOnly(t *testing.T) { + t.Parallel() + for _, c := range []struct { name string block *tfjson.SchemaBlockType @@ -490,7 +517,10 @@ func TestChildBlockIsReadOnly(t *testing.T) { true, }, } { + c := c t.Run(c.name, func(t *testing.T) { + t.Parallel() + actual := childBlockIsReadOnly(c.block) if diff := cmp.Diff(c.expected, actual); diff != "" { t.Fatalf("Unexpected diff (-wanted, +got): %s", diff) diff --git a/schemamd/render.go b/schemamd/render.go index df46a76d..14c06aaa 100644 --- a/schemamd/render.go +++ b/schemamd/render.go @@ -12,11 +12,12 @@ import ( // Render writes a Markdown formatted Schema definition to the specified writer. // A Schema contains a Version and the root Block, for example: -// "aws_accessanalyzer_analyzer": { -// "block": { -// }, -// "version": 0 -// }, +// +// "aws_accessanalyzer_analyzer": { +// "block": { +// }, +// "version": 0 +// }, func Render(schema *tfjson.Schema, w io.Writer) error { _, err := io.WriteString(w, "## Schema\n\n") if err != nil { @@ -178,26 +179,27 @@ func writeRootBlock(w io.Writer, block *tfjson.SchemaBlock) error { // * Description(Kind) // * Deprecated flag // For example: -// "block": { -// "attributes": { -// "certificate_arn": { -// "description_kind": "plain", -// "required": true, -// "type": "string" -// } -// }, -// "block_types": { -// "timeouts": { -// "block": { -// "attributes": { -// }, -// "description_kind": "plain" -// }, -// "nesting_mode": "single" -// } -// }, -// "description_kind": "plain" -// }, +// +// "block": { +// "attributes": { +// "certificate_arn": { +// "description_kind": "plain", +// "required": true, +// "type": "string" +// } +// }, +// "block_types": { +// "timeouts": { +// "block": { +// "attributes": { +// }, +// "description_kind": "plain" +// }, +// "nesting_mode": "single" +// } +// }, +// "description_kind": "plain" +// }, func writeBlockChildren(w io.Writer, parents []string, block *tfjson.SchemaBlock, root bool) error { names := []string{} for n := range block.Attributes { diff --git a/schemamd/render_test.go b/schemamd/render_test.go index f1368bd6..40cb44e2 100644 --- a/schemamd/render_test.go +++ b/schemamd/render_test.go @@ -12,6 +12,8 @@ import ( ) func TestRender(t *testing.T) { + t.Parallel() + for _, c := range []struct { name string inputFile string @@ -38,7 +40,10 @@ func TestRender(t *testing.T) { "testdata/awscc_acmpca_certificate.md", }, } { + c := c t.Run(c.name, func(t *testing.T) { + t.Parallel() + input, err := os.ReadFile(c.inputFile) if err != nil { t.Fatal(err) diff --git a/schemamd/write_attribute_description_test.go b/schemamd/write_attribute_description_test.go index 8c9469f7..17a929a8 100644 --- a/schemamd/write_attribute_description_test.go +++ b/schemamd/write_attribute_description_test.go @@ -12,6 +12,8 @@ import ( ) func TestWriteAttributeDescription(t *testing.T) { + t.Parallel() + for _, c := range []struct { expected string att *tfjson.SchemaAttribute @@ -149,7 +151,10 @@ func TestWriteAttributeDescription(t *testing.T) { }, }, } { + c := c t.Run(c.expected, func(t *testing.T) { + t.Parallel() + b := &strings.Builder{} err := schemamd.WriteAttributeDescription(b, c.att, true) if err != nil { diff --git a/schemamd/write_block_type_description_test.go b/schemamd/write_block_type_description_test.go index 67f8c676..81e29891 100644 --- a/schemamd/write_block_type_description_test.go +++ b/schemamd/write_block_type_description_test.go @@ -10,6 +10,8 @@ import ( ) func TestWriteBlockTypeDescription(t *testing.T) { + t.Parallel() + for _, c := range []struct { expected string bt *tfjson.SchemaBlockType @@ -213,7 +215,10 @@ func TestWriteBlockTypeDescription(t *testing.T) { }, }, } { + c := c t.Run(c.expected, func(t *testing.T) { + t.Parallel() + b := &strings.Builder{} err := schemamd.WriteBlockTypeDescription(b, c.bt) if err != nil { diff --git a/schemamd/write_nested_attribute_type_description_test.go b/schemamd/write_nested_attribute_type_description_test.go index 2a0d16ad..a77b39d2 100644 --- a/schemamd/write_nested_attribute_type_description_test.go +++ b/schemamd/write_nested_attribute_type_description_test.go @@ -11,6 +11,8 @@ import ( ) func TestWriteNestedAttributeTypeDescription(t *testing.T) { + t.Parallel() + for _, c := range []struct { expected string att *tfjson.SchemaAttribute @@ -85,7 +87,10 @@ func TestWriteNestedAttributeTypeDescription(t *testing.T) { }, }, } { + c := c t.Run(c.expected, func(t *testing.T) { + t.Parallel() + b := &strings.Builder{} err := schemamd.WriteNestedAttributeTypeDescription(b, c.att, true) if err != nil { diff --git a/schemamd/write_type_test.go b/schemamd/write_type_test.go index 9a9a4baf..2f84dbde 100644 --- a/schemamd/write_type_test.go +++ b/schemamd/write_type_test.go @@ -12,6 +12,8 @@ import ( ) func TestWriteType(t *testing.T) { + t.Parallel() + for _, c := range []struct { expected string ty cty.Type @@ -44,7 +46,10 @@ func TestWriteType(t *testing.T) { "bool": cty.Bool, }))))}, } { + c := c t.Run(fmt.Sprintf("%s %s", c.ty.FriendlyName(), c.expected), func(t *testing.T) { + t.Parallel() + b := &strings.Builder{} err := schemamd.WriteType(b, c.ty) if err != nil { From 1435bcf80541277175d0700079197f7b9277ffee Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Tue, 24 Jan 2023 13:53:40 -0500 Subject: [PATCH 2/8] adding a timeout --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f39b60b..d1e6be5f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,7 @@ jobs: uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0 with: version: latest + args: --timeout=3m - name: go vet run: go vet ./... - name: Run tests From c399ef7a58dc19488de07f84500135097c16f1a1 Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Tue, 24 Jan 2023 16:42:27 -0500 Subject: [PATCH 3/8] add verbose --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d1e6be5f..532296cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0 with: version: latest - args: --timeout=3m + args: --timeout=3m -v - name: go vet run: go vet ./... - name: Run tests From ad0a4abfa5189385fe0b1ee84dfbc6700c274650 Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Wed, 25 Jan 2023 08:48:00 -0500 Subject: [PATCH 4/8] add CRLF handling --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 532296cf..9e758c27 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,6 +13,10 @@ jobs: - windows-latest - macos-latest steps: + - name: CLRF handling test + run: | + git config --global core.autocrlf true + - name: Check out code uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - name: Setup Go From cb50e799febb940f66f7f3991664e9bad074e674 Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Wed, 25 Jan 2023 08:49:43 -0500 Subject: [PATCH 5/8] test --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e758c27..524b7915 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,9 +9,9 @@ jobs: strategy: matrix: os: - - ubuntu-latest + # - ubuntu-latest - windows-latest - - macos-latest + # - macos-latest steps: - name: CLRF handling test run: | From 99b2fb0028ae67af375fd1ad0d0f280d894fd381 Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Wed, 25 Jan 2023 08:53:05 -0500 Subject: [PATCH 6/8] crlf vs lf --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 524b7915..a1688c6f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,8 @@ jobs: steps: - name: CLRF handling test run: | - git config --global core.autocrlf true + git config --global core.autocrlf false + git config --global core.eol lf - name: Check out code uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 From 782c176a7bcd584b908dac7df4bcf5dee5ada59f Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Wed, 25 Jan 2023 09:00:40 -0500 Subject: [PATCH 7/8] added LF handling for windows --- .github/workflows/test.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a1688c6f..d2ae06a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,11 +9,13 @@ jobs: strategy: matrix: os: - # - ubuntu-latest + - ubuntu-latest - windows-latest - # - macos-latest + - macos-latest steps: - - name: CLRF handling test + # Related issue: https://github.com/golangci/golangci-lint/issues/580 + - name: Ensure LF line endings for gofmt + if: matrix.os == 'windows-latest' run: | git config --global core.autocrlf false git config --global core.eol lf From 70d34ceb93111ec73509952b920acf5ae6f2ba00 Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Wed, 25 Jan 2023 09:04:26 -0500 Subject: [PATCH 8/8] removed verbose on linter --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d2ae06a6..dbc2a49a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: - macos-latest steps: # Related issue: https://github.com/golangci/golangci-lint/issues/580 - - name: Ensure LF line endings for gofmt + - name: Windows - ensure LF line endings for gofmt if: matrix.os == 'windows-latest' run: | git config --global core.autocrlf false @@ -30,7 +30,7 @@ jobs: uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0 with: version: latest - args: --timeout=3m -v + args: --timeout=3m - name: go vet run: go vet ./... - name: Run tests