From c46974775893f4e0a0c16a1b08ddee7251a1f17d Mon Sep 17 00:00:00 2001 From: SalvadorC Date: Mon, 2 Mar 2020 20:12:43 +0100 Subject: [PATCH] renames fixtures as testdata to avoid spurious dependencies (#359) --- test/golint_test.go | 2 +- test/utils.go | 2 +- {fixtures => testdata}/add-constant.go | 0 {fixtures => testdata}/argument-limit.go | 0 {fixtures => testdata}/atomic.go | 0 {fixtures => testdata}/bare-return.go | 0 {fixtures => testdata}/bool-literal-in-expr.go | 0 {fixtures => testdata}/call-to-gc.go | 0 {fixtures => testdata}/cognitive-complexity.go | 0 {fixtures => testdata}/confusing-naming1.go | 0 {fixtures => testdata}/confusing-naming2.go | 0 {fixtures => testdata}/confusing-results.go | 0 {fixtures => testdata}/constant-logical-expr.go | 0 {fixtures => testdata}/cyclomatic-2.go | 0 {fixtures => testdata}/cyclomatic.go | 0 {fixtures => testdata}/deep-exit.go | 0 {fixtures => testdata}/deep-exit_test.go | 0 {fixtures => testdata}/disable-annotations.go | 0 {fixtures => testdata}/disable-annotations2.go | 0 {fixtures => testdata}/duplicated-imports.go | 0 {fixtures => testdata}/empty-block.go | 0 {fixtures => testdata}/empty-lines.go | 0 {fixtures => testdata}/flag-param.go | 0 {fixtures => testdata}/function-result-limit.go | 0 {fixtures => testdata}/get-return.go | 0 {fixtures => testdata}/golint/blank-import-lib.go | 0 {fixtures => testdata}/golint/const-block.go | 0 {fixtures => testdata}/golint/context-as-argument.go | 0 {fixtures => testdata}/golint/context-keys-type.go | 0 {fixtures => testdata}/golint/docs_test.go | 0 {fixtures => testdata}/golint/error-naming.go | 0 {fixtures => testdata}/golint/error-return.go | 0 {fixtures => testdata}/golint/error-strings.go | 0 {fixtures => testdata}/golint/errorf.go | 0 {fixtures => testdata}/golint/exported.go | 0 {fixtures => testdata}/golint/if-return.go | 0 {fixtures => testdata}/golint/import-dot.go | 0 {fixtures => testdata}/golint/increment-decrement.go | 0 {fixtures => testdata}/golint/indent-error-flow.go | 0 {fixtures => testdata}/golint/package-doc1.go | 0 {fixtures => testdata}/golint/package-doc2.go | 0 {fixtures => testdata}/golint/package-doc3.go | 0 {fixtures => testdata}/golint/package-doc4.go | 0 {fixtures => testdata}/golint/package-doc5.go | 0 {fixtures => testdata}/golint/package-main.go | 0 {fixtures => testdata}/golint/range.go | 0 {fixtures => testdata}/golint/receiver-naming.go | 0 {fixtures => testdata}/golint/sort.go | 0 {fixtures => testdata}/golint/stutter.go | 0 {fixtures => testdata}/golint/time-naming.go | 0 {fixtures => testdata}/golint/unexported-return.go | 0 {fixtures => testdata}/golint/value-spec.go | 0 {fixtures => testdata}/golint/var-declaration.go | 0 {fixtures => testdata}/golint/var-naming.go | 0 {fixtures => testdata}/import-shadowing.go | 0 {fixtures => testdata}/imports-blacklist.go | 0 {fixtures => testdata}/line-length-limit.go | 0 {fixtures => testdata}/lint-file-header1.go | 0 {fixtures => testdata}/lint-file-header2.go | 0 {fixtures => testdata}/lint-file-header3.go | 0 {fixtures => testdata}/lint-file-header4.go | 0 {fixtures => testdata}/lint-file-header5.go | 0 {fixtures => testdata}/lint-file-header6.go | 0 {fixtures => testdata}/max-public-structs.go | 0 {fixtures => testdata}/modifies-param.go | 0 {fixtures => testdata}/modifies-value-receiver.go | 0 {fixtures => testdata}/range-val-address.go | 0 {fixtures => testdata}/range-val-in-closure.go | 0 {fixtures => testdata}/redefines-builtin-id.go | 0 {fixtures => testdata}/string-of-int.go | 0 {fixtures => testdata}/struct-tag.go | 0 {fixtures => testdata}/superfluous-else.go | 0 {fixtures => testdata}/unhandled-error-w-ignorelist.go | 0 {fixtures => testdata}/unhandled-error.go | 0 {fixtures => testdata}/unnecessary-stmt.go | 0 {fixtures => testdata}/unreachable-code.go | 0 {fixtures => testdata}/unused-param.go | 0 {fixtures => testdata}/unused-receiver.go | 0 {fixtures => testdata}/var-naming.go | 0 {fixtures => testdata}/waitgroup-by-value.go | 0 80 files changed, 2 insertions(+), 2 deletions(-) rename {fixtures => testdata}/add-constant.go (100%) rename {fixtures => testdata}/argument-limit.go (100%) rename {fixtures => testdata}/atomic.go (100%) rename {fixtures => testdata}/bare-return.go (100%) rename {fixtures => testdata}/bool-literal-in-expr.go (100%) rename {fixtures => testdata}/call-to-gc.go (100%) rename {fixtures => testdata}/cognitive-complexity.go (100%) rename {fixtures => testdata}/confusing-naming1.go (100%) rename {fixtures => testdata}/confusing-naming2.go (100%) rename {fixtures => testdata}/confusing-results.go (100%) rename {fixtures => testdata}/constant-logical-expr.go (100%) rename {fixtures => testdata}/cyclomatic-2.go (100%) rename {fixtures => testdata}/cyclomatic.go (100%) rename {fixtures => testdata}/deep-exit.go (100%) rename {fixtures => testdata}/deep-exit_test.go (100%) rename {fixtures => testdata}/disable-annotations.go (100%) rename {fixtures => testdata}/disable-annotations2.go (100%) rename {fixtures => testdata}/duplicated-imports.go (100%) rename {fixtures => testdata}/empty-block.go (100%) rename {fixtures => testdata}/empty-lines.go (100%) rename {fixtures => testdata}/flag-param.go (100%) rename {fixtures => testdata}/function-result-limit.go (100%) rename {fixtures => testdata}/get-return.go (100%) rename {fixtures => testdata}/golint/blank-import-lib.go (100%) rename {fixtures => testdata}/golint/const-block.go (100%) rename {fixtures => testdata}/golint/context-as-argument.go (100%) rename {fixtures => testdata}/golint/context-keys-type.go (100%) rename {fixtures => testdata}/golint/docs_test.go (100%) rename {fixtures => testdata}/golint/error-naming.go (100%) rename {fixtures => testdata}/golint/error-return.go (100%) rename {fixtures => testdata}/golint/error-strings.go (100%) rename {fixtures => testdata}/golint/errorf.go (100%) rename {fixtures => testdata}/golint/exported.go (100%) rename {fixtures => testdata}/golint/if-return.go (100%) rename {fixtures => testdata}/golint/import-dot.go (100%) rename {fixtures => testdata}/golint/increment-decrement.go (100%) rename {fixtures => testdata}/golint/indent-error-flow.go (100%) rename {fixtures => testdata}/golint/package-doc1.go (100%) rename {fixtures => testdata}/golint/package-doc2.go (100%) rename {fixtures => testdata}/golint/package-doc3.go (100%) rename {fixtures => testdata}/golint/package-doc4.go (100%) rename {fixtures => testdata}/golint/package-doc5.go (100%) rename {fixtures => testdata}/golint/package-main.go (100%) rename {fixtures => testdata}/golint/range.go (100%) rename {fixtures => testdata}/golint/receiver-naming.go (100%) rename {fixtures => testdata}/golint/sort.go (100%) rename {fixtures => testdata}/golint/stutter.go (100%) rename {fixtures => testdata}/golint/time-naming.go (100%) rename {fixtures => testdata}/golint/unexported-return.go (100%) rename {fixtures => testdata}/golint/value-spec.go (100%) rename {fixtures => testdata}/golint/var-declaration.go (100%) rename {fixtures => testdata}/golint/var-naming.go (100%) rename {fixtures => testdata}/import-shadowing.go (100%) rename {fixtures => testdata}/imports-blacklist.go (100%) rename {fixtures => testdata}/line-length-limit.go (100%) rename {fixtures => testdata}/lint-file-header1.go (100%) rename {fixtures => testdata}/lint-file-header2.go (100%) rename {fixtures => testdata}/lint-file-header3.go (100%) rename {fixtures => testdata}/lint-file-header4.go (100%) rename {fixtures => testdata}/lint-file-header5.go (100%) rename {fixtures => testdata}/lint-file-header6.go (100%) rename {fixtures => testdata}/max-public-structs.go (100%) rename {fixtures => testdata}/modifies-param.go (100%) rename {fixtures => testdata}/modifies-value-receiver.go (100%) rename {fixtures => testdata}/range-val-address.go (100%) rename {fixtures => testdata}/range-val-in-closure.go (100%) rename {fixtures => testdata}/redefines-builtin-id.go (100%) rename {fixtures => testdata}/string-of-int.go (100%) rename {fixtures => testdata}/struct-tag.go (100%) rename {fixtures => testdata}/superfluous-else.go (100%) rename {fixtures => testdata}/unhandled-error-w-ignorelist.go (100%) rename {fixtures => testdata}/unhandled-error.go (100%) rename {fixtures => testdata}/unnecessary-stmt.go (100%) rename {fixtures => testdata}/unreachable-code.go (100%) rename {fixtures => testdata}/unused-param.go (100%) rename {fixtures => testdata}/unused-receiver.go (100%) rename {fixtures => testdata}/var-naming.go (100%) rename {fixtures => testdata}/waitgroup-by-value.go (100%) diff --git a/test/golint_test.go b/test/golint_test.go index 492d8f530..e888eeaca 100644 --- a/test/golint_test.go +++ b/test/golint_test.go @@ -36,7 +36,7 @@ var rules = []lint.Rule{ } func TestAll(t *testing.T) { - baseDir := "../fixtures/golint/" + baseDir := "../testdata/golint/" rx, err := regexp.Compile(*lintMatch) if err != nil { diff --git a/test/utils.go b/test/utils.go index 7d7626850..8b14f2284 100644 --- a/test/utils.go +++ b/test/utils.go @@ -20,7 +20,7 @@ import ( ) func testRule(t *testing.T, filename string, rule lint.Rule, config ...*lint.RuleConfig) { - baseDir := "../fixtures/" + baseDir := "../testdata/" filename = filename + ".go" src, err := ioutil.ReadFile(baseDir + filename) if err != nil { diff --git a/fixtures/add-constant.go b/testdata/add-constant.go similarity index 100% rename from fixtures/add-constant.go rename to testdata/add-constant.go diff --git a/fixtures/argument-limit.go b/testdata/argument-limit.go similarity index 100% rename from fixtures/argument-limit.go rename to testdata/argument-limit.go diff --git a/fixtures/atomic.go b/testdata/atomic.go similarity index 100% rename from fixtures/atomic.go rename to testdata/atomic.go diff --git a/fixtures/bare-return.go b/testdata/bare-return.go similarity index 100% rename from fixtures/bare-return.go rename to testdata/bare-return.go diff --git a/fixtures/bool-literal-in-expr.go b/testdata/bool-literal-in-expr.go similarity index 100% rename from fixtures/bool-literal-in-expr.go rename to testdata/bool-literal-in-expr.go diff --git a/fixtures/call-to-gc.go b/testdata/call-to-gc.go similarity index 100% rename from fixtures/call-to-gc.go rename to testdata/call-to-gc.go diff --git a/fixtures/cognitive-complexity.go b/testdata/cognitive-complexity.go similarity index 100% rename from fixtures/cognitive-complexity.go rename to testdata/cognitive-complexity.go diff --git a/fixtures/confusing-naming1.go b/testdata/confusing-naming1.go similarity index 100% rename from fixtures/confusing-naming1.go rename to testdata/confusing-naming1.go diff --git a/fixtures/confusing-naming2.go b/testdata/confusing-naming2.go similarity index 100% rename from fixtures/confusing-naming2.go rename to testdata/confusing-naming2.go diff --git a/fixtures/confusing-results.go b/testdata/confusing-results.go similarity index 100% rename from fixtures/confusing-results.go rename to testdata/confusing-results.go diff --git a/fixtures/constant-logical-expr.go b/testdata/constant-logical-expr.go similarity index 100% rename from fixtures/constant-logical-expr.go rename to testdata/constant-logical-expr.go diff --git a/fixtures/cyclomatic-2.go b/testdata/cyclomatic-2.go similarity index 100% rename from fixtures/cyclomatic-2.go rename to testdata/cyclomatic-2.go diff --git a/fixtures/cyclomatic.go b/testdata/cyclomatic.go similarity index 100% rename from fixtures/cyclomatic.go rename to testdata/cyclomatic.go diff --git a/fixtures/deep-exit.go b/testdata/deep-exit.go similarity index 100% rename from fixtures/deep-exit.go rename to testdata/deep-exit.go diff --git a/fixtures/deep-exit_test.go b/testdata/deep-exit_test.go similarity index 100% rename from fixtures/deep-exit_test.go rename to testdata/deep-exit_test.go diff --git a/fixtures/disable-annotations.go b/testdata/disable-annotations.go similarity index 100% rename from fixtures/disable-annotations.go rename to testdata/disable-annotations.go diff --git a/fixtures/disable-annotations2.go b/testdata/disable-annotations2.go similarity index 100% rename from fixtures/disable-annotations2.go rename to testdata/disable-annotations2.go diff --git a/fixtures/duplicated-imports.go b/testdata/duplicated-imports.go similarity index 100% rename from fixtures/duplicated-imports.go rename to testdata/duplicated-imports.go diff --git a/fixtures/empty-block.go b/testdata/empty-block.go similarity index 100% rename from fixtures/empty-block.go rename to testdata/empty-block.go diff --git a/fixtures/empty-lines.go b/testdata/empty-lines.go similarity index 100% rename from fixtures/empty-lines.go rename to testdata/empty-lines.go diff --git a/fixtures/flag-param.go b/testdata/flag-param.go similarity index 100% rename from fixtures/flag-param.go rename to testdata/flag-param.go diff --git a/fixtures/function-result-limit.go b/testdata/function-result-limit.go similarity index 100% rename from fixtures/function-result-limit.go rename to testdata/function-result-limit.go diff --git a/fixtures/get-return.go b/testdata/get-return.go similarity index 100% rename from fixtures/get-return.go rename to testdata/get-return.go diff --git a/fixtures/golint/blank-import-lib.go b/testdata/golint/blank-import-lib.go similarity index 100% rename from fixtures/golint/blank-import-lib.go rename to testdata/golint/blank-import-lib.go diff --git a/fixtures/golint/const-block.go b/testdata/golint/const-block.go similarity index 100% rename from fixtures/golint/const-block.go rename to testdata/golint/const-block.go diff --git a/fixtures/golint/context-as-argument.go b/testdata/golint/context-as-argument.go similarity index 100% rename from fixtures/golint/context-as-argument.go rename to testdata/golint/context-as-argument.go diff --git a/fixtures/golint/context-keys-type.go b/testdata/golint/context-keys-type.go similarity index 100% rename from fixtures/golint/context-keys-type.go rename to testdata/golint/context-keys-type.go diff --git a/fixtures/golint/docs_test.go b/testdata/golint/docs_test.go similarity index 100% rename from fixtures/golint/docs_test.go rename to testdata/golint/docs_test.go diff --git a/fixtures/golint/error-naming.go b/testdata/golint/error-naming.go similarity index 100% rename from fixtures/golint/error-naming.go rename to testdata/golint/error-naming.go diff --git a/fixtures/golint/error-return.go b/testdata/golint/error-return.go similarity index 100% rename from fixtures/golint/error-return.go rename to testdata/golint/error-return.go diff --git a/fixtures/golint/error-strings.go b/testdata/golint/error-strings.go similarity index 100% rename from fixtures/golint/error-strings.go rename to testdata/golint/error-strings.go diff --git a/fixtures/golint/errorf.go b/testdata/golint/errorf.go similarity index 100% rename from fixtures/golint/errorf.go rename to testdata/golint/errorf.go diff --git a/fixtures/golint/exported.go b/testdata/golint/exported.go similarity index 100% rename from fixtures/golint/exported.go rename to testdata/golint/exported.go diff --git a/fixtures/golint/if-return.go b/testdata/golint/if-return.go similarity index 100% rename from fixtures/golint/if-return.go rename to testdata/golint/if-return.go diff --git a/fixtures/golint/import-dot.go b/testdata/golint/import-dot.go similarity index 100% rename from fixtures/golint/import-dot.go rename to testdata/golint/import-dot.go diff --git a/fixtures/golint/increment-decrement.go b/testdata/golint/increment-decrement.go similarity index 100% rename from fixtures/golint/increment-decrement.go rename to testdata/golint/increment-decrement.go diff --git a/fixtures/golint/indent-error-flow.go b/testdata/golint/indent-error-flow.go similarity index 100% rename from fixtures/golint/indent-error-flow.go rename to testdata/golint/indent-error-flow.go diff --git a/fixtures/golint/package-doc1.go b/testdata/golint/package-doc1.go similarity index 100% rename from fixtures/golint/package-doc1.go rename to testdata/golint/package-doc1.go diff --git a/fixtures/golint/package-doc2.go b/testdata/golint/package-doc2.go similarity index 100% rename from fixtures/golint/package-doc2.go rename to testdata/golint/package-doc2.go diff --git a/fixtures/golint/package-doc3.go b/testdata/golint/package-doc3.go similarity index 100% rename from fixtures/golint/package-doc3.go rename to testdata/golint/package-doc3.go diff --git a/fixtures/golint/package-doc4.go b/testdata/golint/package-doc4.go similarity index 100% rename from fixtures/golint/package-doc4.go rename to testdata/golint/package-doc4.go diff --git a/fixtures/golint/package-doc5.go b/testdata/golint/package-doc5.go similarity index 100% rename from fixtures/golint/package-doc5.go rename to testdata/golint/package-doc5.go diff --git a/fixtures/golint/package-main.go b/testdata/golint/package-main.go similarity index 100% rename from fixtures/golint/package-main.go rename to testdata/golint/package-main.go diff --git a/fixtures/golint/range.go b/testdata/golint/range.go similarity index 100% rename from fixtures/golint/range.go rename to testdata/golint/range.go diff --git a/fixtures/golint/receiver-naming.go b/testdata/golint/receiver-naming.go similarity index 100% rename from fixtures/golint/receiver-naming.go rename to testdata/golint/receiver-naming.go diff --git a/fixtures/golint/sort.go b/testdata/golint/sort.go similarity index 100% rename from fixtures/golint/sort.go rename to testdata/golint/sort.go diff --git a/fixtures/golint/stutter.go b/testdata/golint/stutter.go similarity index 100% rename from fixtures/golint/stutter.go rename to testdata/golint/stutter.go diff --git a/fixtures/golint/time-naming.go b/testdata/golint/time-naming.go similarity index 100% rename from fixtures/golint/time-naming.go rename to testdata/golint/time-naming.go diff --git a/fixtures/golint/unexported-return.go b/testdata/golint/unexported-return.go similarity index 100% rename from fixtures/golint/unexported-return.go rename to testdata/golint/unexported-return.go diff --git a/fixtures/golint/value-spec.go b/testdata/golint/value-spec.go similarity index 100% rename from fixtures/golint/value-spec.go rename to testdata/golint/value-spec.go diff --git a/fixtures/golint/var-declaration.go b/testdata/golint/var-declaration.go similarity index 100% rename from fixtures/golint/var-declaration.go rename to testdata/golint/var-declaration.go diff --git a/fixtures/golint/var-naming.go b/testdata/golint/var-naming.go similarity index 100% rename from fixtures/golint/var-naming.go rename to testdata/golint/var-naming.go diff --git a/fixtures/import-shadowing.go b/testdata/import-shadowing.go similarity index 100% rename from fixtures/import-shadowing.go rename to testdata/import-shadowing.go diff --git a/fixtures/imports-blacklist.go b/testdata/imports-blacklist.go similarity index 100% rename from fixtures/imports-blacklist.go rename to testdata/imports-blacklist.go diff --git a/fixtures/line-length-limit.go b/testdata/line-length-limit.go similarity index 100% rename from fixtures/line-length-limit.go rename to testdata/line-length-limit.go diff --git a/fixtures/lint-file-header1.go b/testdata/lint-file-header1.go similarity index 100% rename from fixtures/lint-file-header1.go rename to testdata/lint-file-header1.go diff --git a/fixtures/lint-file-header2.go b/testdata/lint-file-header2.go similarity index 100% rename from fixtures/lint-file-header2.go rename to testdata/lint-file-header2.go diff --git a/fixtures/lint-file-header3.go b/testdata/lint-file-header3.go similarity index 100% rename from fixtures/lint-file-header3.go rename to testdata/lint-file-header3.go diff --git a/fixtures/lint-file-header4.go b/testdata/lint-file-header4.go similarity index 100% rename from fixtures/lint-file-header4.go rename to testdata/lint-file-header4.go diff --git a/fixtures/lint-file-header5.go b/testdata/lint-file-header5.go similarity index 100% rename from fixtures/lint-file-header5.go rename to testdata/lint-file-header5.go diff --git a/fixtures/lint-file-header6.go b/testdata/lint-file-header6.go similarity index 100% rename from fixtures/lint-file-header6.go rename to testdata/lint-file-header6.go diff --git a/fixtures/max-public-structs.go b/testdata/max-public-structs.go similarity index 100% rename from fixtures/max-public-structs.go rename to testdata/max-public-structs.go diff --git a/fixtures/modifies-param.go b/testdata/modifies-param.go similarity index 100% rename from fixtures/modifies-param.go rename to testdata/modifies-param.go diff --git a/fixtures/modifies-value-receiver.go b/testdata/modifies-value-receiver.go similarity index 100% rename from fixtures/modifies-value-receiver.go rename to testdata/modifies-value-receiver.go diff --git a/fixtures/range-val-address.go b/testdata/range-val-address.go similarity index 100% rename from fixtures/range-val-address.go rename to testdata/range-val-address.go diff --git a/fixtures/range-val-in-closure.go b/testdata/range-val-in-closure.go similarity index 100% rename from fixtures/range-val-in-closure.go rename to testdata/range-val-in-closure.go diff --git a/fixtures/redefines-builtin-id.go b/testdata/redefines-builtin-id.go similarity index 100% rename from fixtures/redefines-builtin-id.go rename to testdata/redefines-builtin-id.go diff --git a/fixtures/string-of-int.go b/testdata/string-of-int.go similarity index 100% rename from fixtures/string-of-int.go rename to testdata/string-of-int.go diff --git a/fixtures/struct-tag.go b/testdata/struct-tag.go similarity index 100% rename from fixtures/struct-tag.go rename to testdata/struct-tag.go diff --git a/fixtures/superfluous-else.go b/testdata/superfluous-else.go similarity index 100% rename from fixtures/superfluous-else.go rename to testdata/superfluous-else.go diff --git a/fixtures/unhandled-error-w-ignorelist.go b/testdata/unhandled-error-w-ignorelist.go similarity index 100% rename from fixtures/unhandled-error-w-ignorelist.go rename to testdata/unhandled-error-w-ignorelist.go diff --git a/fixtures/unhandled-error.go b/testdata/unhandled-error.go similarity index 100% rename from fixtures/unhandled-error.go rename to testdata/unhandled-error.go diff --git a/fixtures/unnecessary-stmt.go b/testdata/unnecessary-stmt.go similarity index 100% rename from fixtures/unnecessary-stmt.go rename to testdata/unnecessary-stmt.go diff --git a/fixtures/unreachable-code.go b/testdata/unreachable-code.go similarity index 100% rename from fixtures/unreachable-code.go rename to testdata/unreachable-code.go diff --git a/fixtures/unused-param.go b/testdata/unused-param.go similarity index 100% rename from fixtures/unused-param.go rename to testdata/unused-param.go diff --git a/fixtures/unused-receiver.go b/testdata/unused-receiver.go similarity index 100% rename from fixtures/unused-receiver.go rename to testdata/unused-receiver.go diff --git a/fixtures/var-naming.go b/testdata/var-naming.go similarity index 100% rename from fixtures/var-naming.go rename to testdata/var-naming.go diff --git a/fixtures/waitgroup-by-value.go b/testdata/waitgroup-by-value.go similarity index 100% rename from fixtures/waitgroup-by-value.go rename to testdata/waitgroup-by-value.go