shisho
shisho copied to clipboard
`be-any-of` Pattern Issue
Description of the bug
be-any-of
constraint in HCL does not recognize the strings properly.
Steps to Reproduce
target code
resource "google_container_cluster" "bad_example" {
logging_service = "none"
}
rule
version: '1'
rules:
- id: 'example'
title: example
language: hcl
patterns:
- pattern: |
resource "google_container_cluster" :[NAME] {
example_service = :[SETTINGS]
}
constraints:
- target: SETTINGS
should: be-any-of
strings:
- "none"
- "example.com"
rewrite: |
resource "google_container_cluster" :[NAME] {
example_service = "example-service"
}
Expected Behaviour
The pattern should match but it does not.
Additional Materials
N/A
It works well by writing as follows:
strings:
- '"none"'
- '"example.com"'