Skip to content

Commit 52bd7bc

Browse files
authored
docs: add support for description in all field of the schemas (#3273)
* feat: add description of webhosting * docs(object): add description for schema fields * docs: add description in schema * docs: add description for domain * docs: add support for description in lb schema * docs: add support for description in instance schema * docs: add support for description in all field of the schemas * Fix linter * Fix linter
1 parent 9b77f47 commit 52bd7bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+835
-517
lines changed

.github/workflows/tfproviderlint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
run: go install github.com/bflad/tfproviderlint/cmd/tfproviderlint
2222
- name: Run tfproviderlint
2323
run: make tfproviderlint
24+
- name: Run tfproviderlintx
25+
run: make tfproviderlintx
2426
tfproviderdocs:
2527
runs-on: ubuntu-latest
2628
steps:

GNUmakefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@ tfproviderlint:
6060

6161
tfproviderdocs:
6262
go tool tfproviderdocs check -provider-name scaleway -enable-contents-check
63+
64+
tfproviderlintx:
65+
go tool tfproviderlintx -XR001=false -XS002=false ./...

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ require (
176176
tool (
177177
github.com/bflad/tfproviderdocs
178178
github.com/bflad/tfproviderlint/cmd/tfproviderlint
179+
github.com/bflad/tfproviderlint/cmd/tfproviderlintx
179180
github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
180181
github.com/katbyte/terrafmt
181182
)

internal/services/baremetal/server.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ If this behaviour is wanted, please set 'reinstall_on_ssh_key_changes' argument
185185
Elem: ResourceServerIP(),
186186
},
187187
"domain": {
188-
Type: schema.TypeString,
189-
Computed: true,
188+
Type: schema.TypeString,
189+
Description: "Domain associated with the server",
190+
Computed: true,
190191
},
191192
"options": {
192193
Type: schema.TypeSet,

internal/services/billing/consumption_data_source.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ func DataSourceConsumptions() *schema.Resource {
2020
"organization_id": account.OrganizationIDSchema(),
2121
"project_id": account.ProjectIDSchema(),
2222
"consumptions": {
23-
Type: schema.TypeList,
24-
Computed: true,
23+
Type: schema.TypeList,
24+
Description: "List of the consumptions.",
25+
Computed: true,
2526
Elem: &schema.Resource{
2627
Schema: map[string]*schema.Schema{
2728
"value": {
@@ -63,8 +64,9 @@ func DataSourceConsumptions() *schema.Resource {
6364
},
6465
},
6566
"updated_at": {
66-
Computed: true,
67-
Type: schema.TypeString,
67+
Computed: true,
68+
Description: "Date and time when the consumption was updated",
69+
Type: schema.TypeString,
6870
},
6971
},
7072
}

internal/services/billing/invoices_data_source.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ func DataSourceInvoices() *schema.Resource {
3434
Description: "The invoice type. It can either be `periodic` or `purchase`",
3535
},
3636
"invoices": {
37-
Type: schema.TypeList,
38-
Computed: true,
37+
Type: schema.TypeList,
38+
Description: "List of invoices",
39+
Computed: true,
3940
Elem: &schema.Resource{
4041
Schema: map[string]*schema.Schema{
4142
"id": {

internal/services/container/domain.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ func ResourceDomain() *schema.Resource {
2626
Timeouts: &schema.ResourceTimeout{
2727
Create: schema.DefaultTimeout(defaultContainerDomainTimeout),
2828
Read: schema.DefaultTimeout(defaultContainerDomainTimeout),
29-
Update: schema.DefaultTimeout(defaultContainerDomainTimeout),
3029
Delete: schema.DefaultTimeout(defaultContainerDomainTimeout),
3130
Default: schema.DefaultTimeout(defaultContainerDomainTimeout),
3231
},

internal/services/container/token.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,39 @@ func ResourceToken() *schema.Resource {
2828
Schema: map[string]*schema.Schema{
2929
"container_id": {
3030
Type: schema.TypeString,
31+
Description: "Container ID",
3132
ForceNew: true,
3233
Optional: true,
3334
ExactlyOneOf: []string{"namespace_id"},
3435
DiffSuppressFunc: dsf.Locality,
3536
},
3637
"namespace_id": {
3738
Type: schema.TypeString,
39+
Description: "Namespace ID",
3840
ForceNew: true,
3941
Optional: true,
4042
ExactlyOneOf: []string{"container_id"},
4143
DiffSuppressFunc: dsf.Locality,
4244
},
4345
"description": {
44-
Type: schema.TypeString,
45-
Optional: true,
46-
ForceNew: true,
46+
Type: schema.TypeString,
47+
Description: "Description of the token.",
48+
Optional: true,
49+
ForceNew: true,
4750
},
4851
"expires_at": {
4952
Type: schema.TypeString,
53+
Description: "Expiration date of the token (TimeRFC3339)",
5054
Optional: true,
5155
ForceNew: true,
5256
ValidateDiagFunc: verify.IsDate(),
5357
DiffSuppressFunc: dsf.TimeRFC3339,
5458
},
5559
"token": {
56-
Type: schema.TypeString,
57-
Computed: true,
58-
Sensitive: true,
60+
Type: schema.TypeString,
61+
Description: "Token",
62+
Computed: true,
63+
Sensitive: true,
5964
},
6065

6166
"region": regional.Schema(),

internal/services/domain/registration.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ func ResourceRegistration() *schema.Resource {
4040
Description: "List of domain names to be managed.",
4141
},
4242
"duration_in_years": {
43-
Type: schema.TypeInt,
44-
Optional: true,
45-
Default: 1,
43+
Type: schema.TypeInt,
44+
Description: "Duration of the registration period in years.",
45+
Optional: true,
46+
Default: 1,
4647
},
4748
"owner_contact_id": {
4849
Type: schema.TypeString,

internal/services/edgeservices/cache_stage.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ func ResourceCacheStage() *schema.Resource {
5656
Description: "The Time To Live (TTL) in seconds. Defines how long content is cached",
5757
},
5858
"purge_requests": {
59-
Type: schema.TypeSet,
60-
Optional: true,
59+
Type: schema.TypeSet,
60+
Description: "Set of purge requests",
61+
Optional: true,
6162
Elem: &schema.Resource{
6263
Schema: map[string]*schema.Schema{
6364
"pipeline_id": {

0 commit comments

Comments
 (0)