Skip to content

Commit 944139c

Browse files
authored
Add depguard rule to restrict pipedv1 to use configv1 (#5732)
* Add depguard rule for pipedv1 Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]> * Fix depguard lint error Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]> * Restore TODO comments Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]> --------- Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
1 parent d0dc88c commit 944139c

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

.golangci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ linters-settings:
4646
desc: "Use go.uber.org/atomic instead of sync/atomic."
4747
- pkg: "io/ioutil"
4848
desc: "Use corresponding 'os' or 'io' functions instead."
49+
pipedv1:
50+
files:
51+
- "**/pkg/app/pipedv1/**/*.go"
52+
deny:
53+
- pkg: "github.com/pipe-cd/pipecd/pkg/config$"
54+
desc: "Use github.com/pipe-cd/pipecd/pkg/configv1 instead."
4955
gocritic:
5056
disabled-checks:
5157
- appendAssign

pkg/app/pipedv1/livestatestore/livestatestore.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"go.uber.org/zap"
2626
"golang.org/x/sync/errgroup"
2727

28-
"github.com/pipe-cd/pipecd/pkg/config"
28+
config "github.com/pipe-cd/pipecd/pkg/configv1"
2929
"github.com/pipe-cd/pipecd/pkg/model"
3030
)
3131

@@ -57,9 +57,7 @@ func NewStore(ctx context.Context, cfg *config.PipedSpec, appLister applicationL
5757
gracePeriod: gracePeriod,
5858
logger: logger,
5959
}
60-
for _, cp := range cfg.PlatformProviders {
61-
_ = cp // TODO: general state from plugin from store fields
62-
}
60+
// TODO: general state from plugin from store fields
6361

6462
return s
6563
}

pkg/app/pipedv1/notifier/matcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package notifier
1616

1717
import (
18-
"github.com/pipe-cd/pipecd/pkg/config"
18+
config "github.com/pipe-cd/pipecd/pkg/configv1"
1919
"github.com/pipe-cd/pipecd/pkg/model"
2020
)
2121

pkg/app/pipedv1/notifier/matcher_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
"github.com/stretchr/testify/assert"
2121

22-
"github.com/pipe-cd/pipecd/pkg/config"
22+
config "github.com/pipe-cd/pipecd/pkg/configv1"
2323
"github.com/pipe-cd/pipecd/pkg/model"
2424
)
2525

pkg/app/pipedv1/notifier/slack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
slackgo "github.com/slack-go/slack"
3030
"go.uber.org/zap"
3131

32-
"github.com/pipe-cd/pipecd/pkg/config"
32+
config "github.com/pipe-cd/pipecd/pkg/configv1"
3333
"github.com/pipe-cd/pipecd/pkg/git"
3434
"github.com/pipe-cd/pipecd/pkg/model"
3535
)

pkg/app/pipedv1/notifier/webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
"go.uber.org/zap"
2626

27-
"github.com/pipe-cd/pipecd/pkg/config"
27+
config "github.com/pipe-cd/pipecd/pkg/configv1"
2828
"github.com/pipe-cd/pipecd/pkg/model"
2929
)
3030

0 commit comments

Comments
 (0)