func()

in rules/no_double_quotes_in_ignore_changes.go [87:111]


func (t *NoDoubleQuotesInIgnoreChangesRule) checkBlock(r tflint.Runner, block *hclext.Block) error {
	for _, subBlock := range block.Body.Blocks {
		ignoreChanges, exists := subBlock.Body.Attributes["ignore_changes"]
		if !exists {
			return nil
		}

		ignoreChangesExpr, ok := ignoreChanges.Expr.(*hclsyntax.TupleConsExpr)
		if !ok {
			return nil
		}

		for _, itemExpr := range ignoreChangesExpr.Exprs {
			if _, ok := itemExpr.(*hclsyntax.ScopeTraversalExpr); !ok {
				return r.EmitIssue(
					t,
					"ignore_changes shouldn't include double quotes",
					ignoreChanges.Range,
				)
			}
		}
	}

	return nil
}