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:
|
||||
enable:
|
||||
- errcheck
|
||||
- gci
|
||||
- goconst
|
||||
- gofmt
|
||||
- gosec
|
||||
- govet
|
||||
- ineffassign
|
||||
- lll
|
||||
- gosimple
|
||||
- staticcheck
|
||||
- misspell
|
||||
- nakedret
|
||||
- revive
|
||||
- unconvert
|
||||
- unused
|
||||
enable-all: false
|
||||
issues:
|
||||
exclude-dirs:
|
||||
- pkg/vendored
|
||||
exclude-files:
|
||||
- schema.go
|
||||
- pulumiManifest.go
|
||||
run:
|
||||
timeout: 20m
|
||||
linters-settings:
|
||||
gci:
|
||||
sections:
|
||||
- standard # Standard section: captures all standard library packages.
|
||||
- blank # Blank section: contains all blank imports.
|
||||
- default # Default section: contains all imports that could not be matched to another section type.
|
||||
- prefix(github.com/pulumi/) # Custom section: groups all imports with the github.com/pulumi/ prefix.
|
||||
- prefix(github.com/pulumi/pulumi-docker-build) # Custom section: local imports
|
||||
custom-order: true
|
||||
- goconst
|
||||
- gosec
|
||||
- lll
|
||||
- misspell
|
||||
- nakedret
|
||||
- revive
|
||||
- unconvert
|
||||
exclusions:
|
||||
generated: lax
|
||||
presets:
|
||||
- comments
|
||||
- common-false-positives
|
||||
- legacy
|
||||
- std-error-handling
|
||||
paths:
|
||||
- schema.go
|
||||
- pulumiManifest.go
|
||||
- pkg/vendored
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
formatters:
|
||||
enable:
|
||||
- gci
|
||||
- gofmt
|
||||
settings:
|
||||
gci:
|
||||
sections:
|
||||
- standard
|
||||
- blank
|
||||
- default
|
||||
- prefix(github.com/pulumi/)
|
||||
- prefix(github.com/pulumi/pulumi-docker-build)
|
||||
custom-order: true
|
||||
exclusions:
|
||||
generated: lax
|
||||
paths:
|
||||
- schema.go
|
||||
- pulumiManifest.go
|
||||
- pkg/vendored
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
|
||||
@@ -10,8 +10,9 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||
)
|
||||
|
||||
func TestDotNetExample(t *testing.T) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package main
|
||||
|
||||
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/config"
|
||||
|
||||
"github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -8,8 +8,9 @@ import (
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||
)
|
||||
|
||||
func TestGoExample(t *testing.T) {
|
||||
|
||||
@@ -8,8 +8,9 @@ import (
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||
)
|
||||
|
||||
func TestJavaExample(t *testing.T) {
|
||||
|
||||
@@ -16,14 +16,15 @@ import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"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/optproviderupgrade"
|
||||
"github.com/pulumi/providertest/pulumitest"
|
||||
"github.com/pulumi/providertest/pulumitest/assertpreview"
|
||||
"github.com/pulumi/providertest/pulumitest/opttest"
|
||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestNodeExample(t *testing.T) {
|
||||
|
||||
@@ -8,8 +8,9 @@ import (
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||
)
|
||||
|
||||
func TestPythonExample(t *testing.T) {
|
||||
|
||||
@@ -8,15 +8,17 @@ import (
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/pulumi/providertest"
|
||||
"github.com/pulumi/providertest/providers"
|
||||
"github.com/pulumi/providertest/pulumitest"
|
||||
"github.com/pulumi/providertest/pulumitest/assertpreview"
|
||||
"github.com/pulumi/providertest/pulumitest/opttest"
|
||||
"github.com/pulumi/pulumi-docker-build/provider"
|
||||
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
|
||||
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) {
|
||||
|
||||
@@ -170,7 +170,7 @@ func hashFile(
|
||||
if fileMode.IsDir() {
|
||||
return nil
|
||||
}
|
||||
if !(fileMode.IsRegular() || fileMode.Type() == os.ModeSymlink) {
|
||||
if !fileMode.IsRegular() && fileMode.Type() != os.ModeSymlink {
|
||||
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-") {
|
||||
//nolint:revive // Human-readable.
|
||||
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 have the correct buildx plugin installed (https://github.com/docker/buildx-desktop)."),
|
||||
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)"), //nolint:lll,staticcheck
|
||||
)
|
||||
}
|
||||
if err != nil && build.ShouldExec() {
|
||||
//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`)"),
|
||||
)
|
||||
}
|
||||
@@ -176,8 +176,8 @@ func (h *host) builderFor(ctx context.Context, build Build) (*cachedBuilder, err
|
||||
if err != nil && !build.ShouldExec() {
|
||||
if strings.Contains(err.Error(), "failed to find driver") {
|
||||
//nolint:revive // Human-readable.
|
||||
err = errors.Join(err, errors.New(
|
||||
"Use `exec: true` if you're trying to use Docker Build Cloud or other custom drivers.",
|
||||
err = errors.Join(err, errors.New( //nolint:staticcheck
|
||||
"Use `exec: true` if you're trying to use Docker Build Cloud or other custom drivers",
|
||||
))
|
||||
}
|
||||
return nil, fmt.Errorf("loading nodes: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user