Upgrade to golangci-lint v2 (#775)
Upgrades golangci-lint from v1 to v2. Automated by Linear issue IT-144. Co-authored-by: CI <ci@pulumi.com>
This commit is contained in:
@@ -1,37 +1,46 @@
|
|||||||
# WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt
|
version: "2"
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
- errcheck
|
|
||||||
- gci
|
|
||||||
- goconst
|
- goconst
|
||||||
- gofmt
|
|
||||||
- gosec
|
- gosec
|
||||||
- govet
|
|
||||||
- ineffassign
|
|
||||||
- lll
|
- lll
|
||||||
- gosimple
|
|
||||||
- staticcheck
|
|
||||||
- misspell
|
- misspell
|
||||||
- nakedret
|
- nakedret
|
||||||
- revive
|
- revive
|
||||||
- unconvert
|
- unconvert
|
||||||
- unused
|
exclusions:
|
||||||
enable-all: false
|
generated: lax
|
||||||
issues:
|
presets:
|
||||||
exclude-dirs:
|
- comments
|
||||||
- pkg/vendored
|
- common-false-positives
|
||||||
exclude-files:
|
- legacy
|
||||||
|
- std-error-handling
|
||||||
|
paths:
|
||||||
- schema.go
|
- schema.go
|
||||||
- pulumiManifest.go
|
- pulumiManifest.go
|
||||||
run:
|
- pkg/vendored
|
||||||
timeout: 20m
|
- third_party$
|
||||||
linters-settings:
|
- builtin$
|
||||||
|
- examples$
|
||||||
|
formatters:
|
||||||
|
enable:
|
||||||
|
- gci
|
||||||
|
- gofmt
|
||||||
|
settings:
|
||||||
gci:
|
gci:
|
||||||
sections:
|
sections:
|
||||||
- standard # Standard section: captures all standard library packages.
|
- standard
|
||||||
- blank # Blank section: contains all blank imports.
|
- blank
|
||||||
- default # Default section: contains all imports that could not be matched to another section type.
|
- default
|
||||||
- prefix(github.com/pulumi/) # Custom section: groups all imports with the github.com/pulumi/ prefix.
|
- prefix(github.com/pulumi/)
|
||||||
- prefix(github.com/pulumi/pulumi-docker-build) # Custom section: local imports
|
- prefix(github.com/pulumi/pulumi-docker-build)
|
||||||
custom-order: true
|
custom-order: true
|
||||||
|
exclusions:
|
||||||
|
generated: lax
|
||||||
|
paths:
|
||||||
|
- schema.go
|
||||||
|
- pulumiManifest.go
|
||||||
|
- pkg/vendored
|
||||||
|
- third_party$
|
||||||
|
- builtin$
|
||||||
|
- examples$
|
||||||
|
|||||||
@@ -10,8 +10,9 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDotNetExample(t *testing.T) {
|
func TestDotNetExample(t *testing.T) {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild"
|
|
||||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
|
||||||
|
|
||||||
|
"github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGoExample(t *testing.T) {
|
func TestGoExample(t *testing.T) {
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestJavaExample(t *testing.T) {
|
func TestJavaExample(t *testing.T) {
|
||||||
|
|||||||
@@ -16,14 +16,15 @@ import (
|
|||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/session"
|
"github.com/aws/aws-sdk-go/aws/session"
|
||||||
"github.com/aws/aws-sdk-go/service/ecr"
|
"github.com/aws/aws-sdk-go/service/ecr"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/pulumi/providertest"
|
"github.com/pulumi/providertest"
|
||||||
"github.com/pulumi/providertest/optproviderupgrade"
|
"github.com/pulumi/providertest/optproviderupgrade"
|
||||||
"github.com/pulumi/providertest/pulumitest"
|
"github.com/pulumi/providertest/pulumitest"
|
||||||
"github.com/pulumi/providertest/pulumitest/assertpreview"
|
"github.com/pulumi/providertest/pulumitest/assertpreview"
|
||||||
"github.com/pulumi/providertest/pulumitest/opttest"
|
"github.com/pulumi/providertest/pulumitest/opttest"
|
||||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNodeExample(t *testing.T) {
|
func TestNodeExample(t *testing.T) {
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPythonExample(t *testing.T) {
|
func TestPythonExample(t *testing.T) {
|
||||||
|
|||||||
@@ -8,15 +8,17 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/pulumi/providertest"
|
"github.com/pulumi/providertest"
|
||||||
"github.com/pulumi/providertest/providers"
|
"github.com/pulumi/providertest/providers"
|
||||||
"github.com/pulumi/providertest/pulumitest"
|
"github.com/pulumi/providertest/pulumitest"
|
||||||
"github.com/pulumi/providertest/pulumitest/assertpreview"
|
"github.com/pulumi/providertest/pulumitest/assertpreview"
|
||||||
"github.com/pulumi/providertest/pulumitest/opttest"
|
"github.com/pulumi/providertest/pulumitest/opttest"
|
||||||
"github.com/pulumi/pulumi-docker-build/provider"
|
|
||||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||||
pulumirpc "github.com/pulumi/pulumi/sdk/v3/proto/go"
|
pulumirpc "github.com/pulumi/pulumi/sdk/v3/proto/go"
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
|
"github.com/pulumi/pulumi-docker-build/provider"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestYAMLExample(t *testing.T) {
|
func TestYAMLExample(t *testing.T) {
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ func hashFile(
|
|||||||
if fileMode.IsDir() {
|
if fileMode.IsDir() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if !(fileMode.IsRegular() || fileMode.Type() == os.ModeSymlink) {
|
if !fileMode.IsRegular() && fileMode.Type() != os.ModeSymlink {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,13 +98,13 @@ func (h *host) builderFor(ctx context.Context, build Build) (*cachedBuilder, err
|
|||||||
if err != nil && build.ShouldExec() && strings.HasPrefix(opts.Builder, "cloud-") {
|
if err != nil && build.ShouldExec() && strings.HasPrefix(opts.Builder, "cloud-") {
|
||||||
//nolint:revive // Human-readable.
|
//nolint:revive // Human-readable.
|
||||||
err = errors.Join(err,
|
err = errors.Join(err,
|
||||||
errors.New("Make sure you're logged in to Docker (`docker login`) if you're trying to use a cloud builder."),
|
errors.New("Make sure you're logged in to Docker (`docker login`) if you're trying to use a cloud builder"), //nolint:lll,staticcheck
|
||||||
errors.New("Make sure you have the correct buildx plugin installed (https://github.com/docker/buildx-desktop)."),
|
errors.New("Make sure you have the correct buildx plugin installed (https://github.com/docker/buildx-desktop)"), //nolint:lll,staticcheck
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if err != nil && build.ShouldExec() {
|
if err != nil && build.ShouldExec() {
|
||||||
//nolint:revive // Human-readable.
|
//nolint:revive // Human-readable.
|
||||||
err = errors.Join(err, errors.New(
|
err = errors.Join(err, errors.New( //nolint:staticcheck
|
||||||
"Make sure your buildx plugin is executable (`docker buildx version`)"),
|
"Make sure your buildx plugin is executable (`docker buildx version`)"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -176,8 +176,8 @@ func (h *host) builderFor(ctx context.Context, build Build) (*cachedBuilder, err
|
|||||||
if err != nil && !build.ShouldExec() {
|
if err != nil && !build.ShouldExec() {
|
||||||
if strings.Contains(err.Error(), "failed to find driver") {
|
if strings.Contains(err.Error(), "failed to find driver") {
|
||||||
//nolint:revive // Human-readable.
|
//nolint:revive // Human-readable.
|
||||||
err = errors.Join(err, errors.New(
|
err = errors.Join(err, errors.New( //nolint:staticcheck
|
||||||
"Use `exec: true` if you're trying to use Docker Build Cloud or other custom drivers.",
|
"Use `exec: true` if you're trying to use Docker Build Cloud or other custom drivers",
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("loading nodes: %w", err)
|
return nil, fmt.Errorf("loading nodes: %w", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user