Skip to content

Commit 4d8110e

Browse files
committed
chore: groups importas files to a package
1 parent 7567a5d commit 4d8110e

File tree

7 files changed

+17
-5
lines changed

7 files changed

+17
-5
lines changed

pkg/golinters/importas.go renamed to pkg/golinters/importas/importas.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package golinters
1+
package importas
22

33
import (
44
"fmt"
@@ -13,7 +13,7 @@ import (
1313
"github.com/golangci/golangci-lint/pkg/lint/linter"
1414
)
1515

16-
func NewImportAs(settings *config.ImportAsSettings) *goanalysis.Linter {
16+
func New(settings *config.ImportAsSettings) *goanalysis.Linter {
1717
analyzer := importas.Analyzer
1818

1919
return goanalysis.NewLinter(
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package importas
2+
3+
import (
4+
"testing"
5+
6+
"github.com/golangci/golangci-lint/test/testshared/integration"
7+
)
8+
9+
func TestFromTestdata(t *testing.T) {
10+
integration.RunTestdata(t)
11+
}

test/testdata/importas.go renamed to pkg/golinters/importas/testdata/importas.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Eimportas
2-
//golangcitest:config_path testdata/configs/importas.yml
2+
//golangcitest:config_path testdata/importas.yml
33
package testdata
44

55
import (

test/testdata/importas_strict.go renamed to pkg/golinters/importas/testdata/importas_strict.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Eimportas
2-
//golangcitest:config_path testdata/configs/importas_strict.yml
2+
//golangcitest:config_path testdata/importas_strict.yml
33
package testdata
44

55
import (

pkg/lint/lintersdb/builder_linter.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import (
5454
"github.com/golangci/golangci-lint/pkg/golinters/gosmopolitan"
5555
"github.com/golangci/golangci-lint/pkg/golinters/govet"
5656
"github.com/golangci/golangci-lint/pkg/golinters/grouper"
57+
"github.com/golangci/golangci-lint/pkg/golinters/importas"
5758
"github.com/golangci/golangci-lint/pkg/golinters/loggercheck"
5859
"github.com/golangci/golangci-lint/pkg/golinters/mirror"
5960
"github.com/golangci/golangci-lint/pkg/golinters/misspell"
@@ -423,7 +424,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
423424
WithURL("https://github.com/esimonov/ifshort").
424425
Deprecated("The repository of the linter has been deprecated by the owner.", "v1.48.0", ""),
425426

426-
linter.NewConfig(golinters.NewImportAs(&cfg.LintersSettings.ImportAs)).
427+
linter.NewConfig(importas.New(&cfg.LintersSettings.ImportAs)).
427428
WithSince("v1.38.0").
428429
WithPresets(linter.PresetStyle).
429430
WithLoadForGoAnalysis().

0 commit comments

Comments
 (0)