Closed ruzickap closed 3 weeks ago
Have you tried enabling blocks? https://github.com/google/keep-sorted#blocks
Thank you.
It seems like block=yes
"almost" did the job and I got following output:
# keep-sorted start block=yes
# [CloudDNS-001] Cloud DNS public DNS managed zone should have DNSSEC enabled
data "wiz_cloud_configuration_rules" "clouddns_001" {
search = "CloudDNS-001"
}
# [CloudFront-007] CloudFront distribution should be associated with a WAF web ACL
data "wiz_cloud_configuration_rules" "cloudfront_007" {
search = "CloudFront-007"
}
# [CloudFront-010] CloudFront distribution logging should be enabled
data "wiz_cloud_configuration_rules" "cloudfront_010" {
search = "CloudFront-010"
}
# [CloudSQL-027] SQL Database should be configured to send Threat Detection email alerts
data "wiz_cloud_configuration_rules" "cloudsql_027" {
search = "CloudSQL-027"
}
# keep-sorted end
^^^ It is correct now - thank you for the tip.
Is there any way how I can keep "empty line" between the data blocks? (It is more readable...)
Thanks...
https://github.com/google/keep-sorted#newline-separated
Also add newline_separated=yes
to your keep-sorted start
line
Thanks a lot... Both of these parameters did the right job.
# keep-sorted start block=yes newline_separated=yes
....
Closing...
I'm trying to sort the following Terraform's
data.tf
which looks like:After using the
keep-sorted
I got:As you can see the
}
and new lines are missing. Theremove_duplicates=no
doesn't help to sort it properly. (ChatGPT or Gemini can do it, but that is not what I'm looking for...)Anyway - can
keep-sorted
work with HCL / Terraform syntax and sort such files?Thank you