diff --git a/pkg/commands/internal/migrate/migrate_formatters.go b/pkg/commands/internal/migrate/migrate_formatters.go index b2b22ac52069..2575fedc1426 100644 --- a/pkg/commands/internal/migrate/migrate_formatters.go +++ b/pkg/commands/internal/migrate/migrate_formatters.go @@ -18,7 +18,7 @@ func toFormatters(old *versionone.Config) versiontwo.Formatters { } if old.Issues.UseDefaultExcludeDirs == nil || ptr.Deref(old.Issues.UseDefaultExcludeDirs) { - paths = append(paths, "examples$") + paths = append(paths, "third_party$", "builtin$", "examples$") } paths = append(paths, toFormattersPathsFromRules(old.Issues)...) diff --git a/pkg/commands/internal/migrate/testdata/json/empty.golden.json b/pkg/commands/internal/migrate/testdata/json/empty.golden.json index 019cc1ee7f82..92ef827af5c0 100644 --- a/pkg/commands/internal/migrate/testdata/json/empty.golden.json +++ b/pkg/commands/internal/migrate/testdata/json/empty.golden.json @@ -3,6 +3,8 @@ "exclusions": { "generated": "lax", "paths": [ + "third_party$", + "builtin$", "examples$" ] } diff --git a/pkg/commands/internal/migrate/testdata/toml/empty.golden.toml b/pkg/commands/internal/migrate/testdata/toml/empty.golden.toml index 5b9e9de21202..e3c85a21f091 100644 --- a/pkg/commands/internal/migrate/testdata/toml/empty.golden.toml +++ b/pkg/commands/internal/migrate/testdata/toml/empty.golden.toml @@ -19,5 +19,7 @@ paths = [ [formatters.exclusions] generated = 'lax' paths = [ + 'third_party$', + 'builtin$', 'examples$' ] diff --git a/pkg/commands/internal/migrate/testdata/yaml/empty.golden.yml b/pkg/commands/internal/migrate/testdata/yaml/empty.golden.yml index 10272697f830..d6301eebb0eb 100644 --- a/pkg/commands/internal/migrate/testdata/yaml/empty.golden.yml +++ b/pkg/commands/internal/migrate/testdata/yaml/empty.golden.yml @@ -15,4 +15,6 @@ formatters: exclusions: generated: lax paths: + - third_party$ + - builtin$ - examples$ diff --git a/pkg/commands/internal/migrate/testdata/yaml/issues_07_a.golden.yml b/pkg/commands/internal/migrate/testdata/yaml/issues_07_a.golden.yml index 889baa58848a..c90acfa81f06 100644 --- a/pkg/commands/internal/migrate/testdata/yaml/issues_07_a.golden.yml +++ b/pkg/commands/internal/migrate/testdata/yaml/issues_07_a.golden.yml @@ -8,4 +8,6 @@ linters: formatters: exclusions: paths: + - third_party$ + - builtin$ - examples$ diff --git a/pkg/commands/internal/migrate/testdata/yaml/issues_07_b.golden.yml b/pkg/commands/internal/migrate/testdata/yaml/issues_07_b.golden.yml index 4b3500282ebc..299f8bb92b8f 100644 --- a/pkg/commands/internal/migrate/testdata/yaml/issues_07_b.golden.yml +++ b/pkg/commands/internal/migrate/testdata/yaml/issues_07_b.golden.yml @@ -11,4 +11,6 @@ formatters: - goimports exclusions: paths: + - third_party$ + - builtin$ - examples$ diff --git a/pkg/commands/internal/migrate/testdata/yaml/unknown-fields.golden.yml b/pkg/commands/internal/migrate/testdata/yaml/unknown-fields.golden.yml index 10272697f830..d6301eebb0eb 100644 --- a/pkg/commands/internal/migrate/testdata/yaml/unknown-fields.golden.yml +++ b/pkg/commands/internal/migrate/testdata/yaml/unknown-fields.golden.yml @@ -15,4 +15,6 @@ formatters: exclusions: generated: lax paths: + - third_party$ + - builtin$ - examples$ diff --git a/pkg/goformat/runner.go b/pkg/goformat/runner.go index 9b2c1b41b0cb..7bb0460268a5 100644 --- a/pkg/goformat/runner.go +++ b/pkg/goformat/runner.go @@ -194,9 +194,6 @@ func skipDir(name string) bool { case "vendor", "testdata", "node_modules": return true - case "third_party", "builtin": // For compatibility with `exclude-dirs-use-default`. - return true - default: return strings.HasPrefix(name, ".") }