Skip to content

Commit

Permalink
1. Renamed testdata package
Browse files Browse the repository at this point in the history
2. Renamed linter
  • Loading branch information
maranqz committed Nov 12, 2023
1 parent 2cebf9f commit e885a15
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 12 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,6 @@ func nextID() int64 {

## TODO

### Features that are difficult to implement and unplanned

1. Type assertion, type declaration and type underlying, [tests](testdata/src/factory/default/type_nested.go.skip).
2 changes: 1 addition & 1 deletion factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const (

func NewAnalyzer() *analysis.Analyzer {
analyzer := &analysis.Analyzer{
Name: "factory",
Name: "gofactory",
Doc: "Blocks the creation of structures directly, without a factory.",
Requires: []*analysis.Analyzer{inspect.Analyzer},
}
Expand Down
2 changes: 1 addition & 1 deletion lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestLinterSuite(t *testing.T) {
pkgs []string
prepare func(t *testing.T, a *analysis.Analyzer)
}{
"default": {pkgs: []string{"default/..."}},
"simple": {pkgs: []string{"simple/..."}},
"blockedPkgs": {
pkgs: []string{"blockedPkgs/..."},
prepare: func(t *testing.T, a *analysis.Analyzer) {
Expand Down
2 changes: 1 addition & 1 deletion testdata/src/factory/blockedPkgs/blocked/blocked.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package blocked

import (
"factory/blockedPkgs/blocked/blocked_nested"
"factory/default/nested"
"factory/simple/nested"
)

type Struct struct{}
Expand Down
4 changes: 0 additions & 4 deletions testdata/src/factory/onlyBlockedPkgs/blocked/blocked.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package blocked

import (
"factory/default/nested"
"factory/onlyBlockedPkgs/blocked/blocked_nested"
)

Expand All @@ -22,7 +21,4 @@ func NewPtr() *Struct {
func CallNested2() {
_ = blocked_nested.Struct{}
_ = &blocked_nested.Struct{}

_ = nested.Struct{}
_ = &nested.Struct{}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package blockedPkgs
package simple

import "factory/default/nested"
import "factory/simple/nested"

type Struct struct {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package blockedPkgs
package simple

import "factory/default/nested"
import "factory/simple/nested"

// ident.Obj.Decl.Type could be used to get underlying
// ident.Obj.Decl.Type or use dst could be used to get underlying
type DeclStruct nested.Struct
type AliasStruct = nested.Struct
type UnderlyingStruct struct {
Expand Down

0 comments on commit e885a15

Please sign in to comment.