Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
go-version: 'stable'
cache: true
- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
- name: Run golangci-lint
run: golangci-lint run ./...
test:
Expand Down
118 changes: 53 additions & 65 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,68 @@
run:
timeout: 5m

linters-settings:
govet:
enable-all: true
disable:
- shadow
misspell:
locale: US
lll:
line-length: 160
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming
- name: var-naming
forbidigo:
forbid:
- t\.Fatal.*
- fmt\.Print.*

version: "2"
linters:
disable-all: true
default: none
enable:
# Errcheck is a program for checking for unchecked errors in go programs.
# These unchecked errors can be critical bugs in some cases
- errcheck
# Linter for Go source code that specializes in simplifying a code
- gosimple
# Vet examines Go source code and reports suspicious constructs,
# such as Printf calls whose arguments do not align with the format string
- govet
# Forbids identifiers
- forbidigo
# Staticcheck is a go vet on steroids, applying a ton of static analysis checks
- staticcheck
# Like the front-end of a Go compiler, parses and type-checks Go code
- typecheck
# Checks Go code for unused constants, variables, functions and types
- unused
# checks whether HTTP response body is closed successfully
- bodyclose
# containedctx is a linter that detects struct contained context.Context field
- containedctx
# Checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error.
- errname
# A linter detects places where loop variables are copied.
- copyloopvar
# Gofumpt checks whether code was gofumpt-ed.
- gofumpt
# Reports long lines
- errcheck
- errname
- forbidigo
- govet
- lll
# Finds commonly misspelled English words in comments
- misspell
# Finds naked returns in functions greater than a specified function length
- nakedret
# paralleltest detects missing usage of t.Parallel() method in your Go test
- paralleltest
# Finds slice declarations that could potentially be pre-allocated
- prealloc
# find code that shadows one of Go's predeclared identifiers
- predeclared
# Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint
- revive
# Stylecheck is a replacement for golint
- stylecheck
# Reports uses of functions with replacement inside the testing package.
- staticcheck
- unused
- usetesting

settings:
forbidigo:
forbid:
- pattern: t\.Fatal.*
- pattern: fmt\.Print.*
govet:
disable:
- shadow
enable-all: true
lll:
line-length: 165
misspell:
locale: US
revive:
rules:
- name: var-naming
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- govet
path: \.go
text: 'fieldalignment:'
- linters:
- staticcheck
path: \.go
text: 'SA1019'
paths:
- third_party$
- builtin$
- examples$
issues:
exclude-use-default: true
max-per-linter: 0
max-same-issues: 0
exclude: []
exclude-rules:
# All
- path: \.go
text: "fieldalignment:"
linters:
- govet
formatters:
enable:
- gofumpt
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
12 changes: 11 additions & 1 deletion docs/data-sources/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ PipeCD application resource.
- `kind` (String) The kind of application.
- `name` (String) The application name.
- `piped_id` (String) The ID of piped that should handle this application.
- `platform_provider` (String) The platform provider name. One of the registered providers in the piped configuration. The previous name of this field is cloud-provider.
- `platform_provider` (String, Deprecated) The platform provider name. One of the registered providers in the piped configuration. The previous name of this field is cloud-provider.
- `plugins` (Attributes List) The list of plugins that this application uses. (see [below for nested schema](#nestedatt--plugins))
- `project_id` (String)

<a id="nestedatt--git"></a>
Expand All @@ -39,3 +40,12 @@ Read-Only:
- `path` (String) The relative path from the root of repository to the application directory.
- `remote` (String)
- `repository_id` (String) The repository ID. One the registered repositories in the piped configuration.


<a id="nestedatt--plugins"></a>
### Nested Schema for `plugins`

Read-Only:

- `deploy_targets` (List of String) The list of deploy targets that this plugin uses.
- `name` (String) The name of the plugin.
12 changes: 11 additions & 1 deletion docs/data-sources/piped.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ PipeCD pied data source.
- `description` (String)
- `id` (String) The ID of this resource.
- `name` (String)
- `platform_providers` (Attributes List) (see [below for nested schema](#nestedatt--platform_providers))
- `platform_providers` (Attributes List, Deprecated) (see [below for nested schema](#nestedatt--platform_providers))
- `plugins` (Attributes List) The list of plugins that this piped uses. (see [below for nested schema](#nestedatt--plugins))
- `project_id` (String)
- `repositories` (Attributes List) (see [below for nested schema](#nestedatt--repositories))

Expand All @@ -33,6 +34,15 @@ Read-Only:
- `type` (String)


<a id="nestedatt--plugins"></a>
### Nested Schema for `plugins`

Read-Only:

- `deploy_targets` (List of String) The list of deploy targets that this plugin uses.
- `name` (String) The name of the plugin.


<a id="nestedatt--repositories"></a>
### Nested Schema for `repositories`

Expand Down
14 changes: 11 additions & 3 deletions docs/resources/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ PipeCD application resource.
- `kind` (String) The kind of application.
- `name` (String) The application name.
- `piped_id` (String) The ID of piped that should handle this application.
- `platform_provider` (String) The platform provider name. One of the registered providers in the piped configuration. The previous name of this field is cloud-provider.

### Optional

- `description` (String) The description of the application.
- `platform_provider` (String, Deprecated) The platform provider name. One of the registered providers in the piped configuration. The previous name of this field is cloud-provider.
- `plugins` (Attributes List) The list of plugins that this application uses. (see [below for nested schema](#nestedatt--plugins))

### Read-Only

Expand All @@ -41,6 +42,13 @@ Required:

Optional:

- `branch` (String)
- `filename` (String) The configuration file name. (default "app.pipecd.yaml")
- `remote` (String)


<a id="nestedatt--plugins"></a>
### Nested Schema for `plugins`

Required:

- `deploy_targets` (List of String) The list of deploy targets that this plugin uses.
- `name` (String) The name of the plugin.
2 changes: 1 addition & 1 deletion docs/resources/piped.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ PipeCD piped resource.

### Read-Only

- `api_key` (String) The API key of the piped.
- `api_key` (String, Sensitive) The API key of the piped.
- `id` (String) The ID of piped that should handle this application.
20 changes: 9 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
module github.com/pipe-cd/terraform-provider-pipecd

go 1.23.0

toolchain go1.24.1
go 1.24.1

require (
github.com/golang/mock v1.6.0
github.com/hashicorp/terraform-plugin-docs v0.21.0
github.com/hashicorp/terraform-plugin-framework v1.14.1
github.com/hashicorp/terraform-plugin-framework-validators v0.17.0
github.com/hashicorp/terraform-plugin-go v0.26.0
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-testing v1.12.0
github.com/pipe-cd/pipecd v0.50.2
github.com/pipe-cd/pipecd v0.51.2
go.uber.org/mock v0.5.0
google.golang.org/grpc v1.72.0
)

Expand All @@ -32,8 +30,8 @@ require (
github.com/coreos/go-oidc/v3 v3.11.0 // indirect
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/go-jose/go-jose/v4 v4.0.4 // indirect
github.com/golang-jwt/jwt v3.2.1+incompatible // indirect
github.com/go-jose/go-jose/v4 v4.0.5 // indirect
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
Expand Down Expand Up @@ -78,13 +76,13 @@ require (
github.com/yuin/goldmark-meta v1.1.0 // indirect
github.com/zclconf/go-cty v1.16.2 // indirect
go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.2.0 // indirect
go.uber.org/zap v1.10.1-0.20190709142728-9a9fa7d4b5f0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.37.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/oauth2 v0.26.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/sys v0.31.0 // indirect
Expand Down
Loading