You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
terraform: _find_block() corrupted by unbalanced braces in string literals #7
_find_block() in terraform_analyzer.py counts { and } characters to locate block boundaries but does not skip characters inside HCL string literals or comments. Balanced {...} pairs in strings (e.g. "my-{env}-vpc") cancel out and are harmless, but a string containing an unbalanced brace (e.g. default = "prefix-{") would corrupt the depth counter, causing the extracted block body to be truncated or over-extended.
Impact:_module_sources() and the locals extraction loop both call _find_block(). A corrupted block causes module source links or local variable definitions in the same file to be silently dropped, producing an incomplete graph with no error or warning.
Fix: Track whether the scanner is inside a quoted string (toggle on unescaped ") and skip brace counting while inside one. Also skip #/// line comments and /* */ block comments.
Activity
fix: terraform outputs.tf misclassified + _find_block string safety