Open y-matsutomo opened 3 years ago
rewrite does not overwrite the target block when it implements in empty blocks.
rewrite
target code
resource "google_container_cluster" "bad_example" { example_policy { } }
rule
version: '1' rules: - id: 'exapmle' title: exapmle language: hcl message: example patterns: - pattern: | resource "google_container_cluster" :[NAME] { :[...SETTINGS] } constraints: - target: SETTINGS should: not-match-any-of patterns: - pattern: example_policy = {} - pattern: | example_policy { :[...] } rewrite: | resource "google_container_cluster" :[NAME] { :[SETTINGS] example_policy = {} }
It should be overwritten as:
resource "google_container_cluster" "bad_example" { :[SETTINGS] example_policy = {} }
But it returns as:
resource "google_container_cluster" :[NAME] { :[SETTINGS] example_policy { } example_policy = {} }
N/A
Description of the bug
rewrite
does not overwrite the target block when it implements in empty blocks.Steps to Reproduce
target code
rule
Expected Behaviour
It should be overwritten as:
But it returns as:
Additional Materials
N/A