no-restated-comment
Flag a short comment attached to an HCL declaration when it only repeats that declaration's kind, label, or attribute name.
Why
A declaration-label comment adds no durable information and can drift; comments that explain constraints, grouping, or operational rationale remain useful.
Fix
Delete the restatement or replace it with the constraint the configuration cannot express. Improve an author-controlled label when the declaration itself is unclear.
Examples
locals { # Set instance type instance_type = "standard"}locals { # Keep this type because the provider rejects ARM nodes. instance_type = "standard"}Autofix output
locals {
instance_type = "standard"}locals { /* Set instance type */ instance_type = "standard"}/* Code generated by schema compiler. * DO NOT EDIT. */locals { # Set instance type instance_type = "standard"}locals { # Service account service_account_email = "api@example.test"}locals { # Service accounts api_service_account_email = "api@example.test" worker_service_account_email = "worker@example.test"}