Skip to content

XS001 False positive when descriptions come from map #241

@armsnyder

Description

@armsnyder

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

tfproviderlint and terraform-plugin-sdk Version

tfproviderlint v0.27.0
terraform-plugin-sdk v1.16.1

Affected Check(s) or Function(s)

  • XS001

Expected Behavior

func Provider() terraform.ResourceProvider {
	provider := &schema.Provider{
		Schema: map[string]*schema.Schema{
			"token": {
				Type:        schema.TypeString,
				Required:    true,
				Description: descriptions["token"],
			},
...
func init() {
	descriptions = map[string]string{
		"token": "The OAuth token used to connect to the API.",
...

Should be accepted.

Actual Behavior

The linter complains.

XS001: schema should configure Description

I will try to resolve this and may submit a PR sometime this week.

Metadata

Metadata

Assignees

Labels

astAST HandlingbugSomething isn't workingcheck/schemaSchema Check

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions