func()

in rules/terraform_output_order.go [61:76]


func (r *TerraformOutputOrderRule) checkOutputOrder(runner tflint.Runner, file *hcl.File) error {
	body, ok := file.Body.(*hclsyntax.Body)
	if !ok {
		logger.Debug("skip terraform_output_order check since it's not hcl file")
		return nil
	}
	blocks := body.Blocks
	firstOutputBlockRange := r.firstOutputRange(blocks)
	if firstOutputBlockRange == nil {
		return nil
	}
	if r.sorted(blocks) {
		return nil
	}
	return r.suggestedOrder(runner, file, blocks, firstOutputBlockRange)
}