mirror of
https://github.com/dbt-labs/dbt-project-evaluator.git
synced 2025-12-18 02:11:27 +00:00
Fix typo in var name
This commit is contained in:
@@ -17,13 +17,13 @@
|
||||
|
||||
{# we remove the comments that start with -- , or other characters configured #}
|
||||
{%- set comment_chars_match = "(" ~ var('comment_chars') | join("|") ~ ").*" -%}
|
||||
{%- set model_raw_sql_co_comments = re.sub(comment_chars_match, '', model_raw_sql) -%}
|
||||
{%- set model_raw_sql_no_comments = re.sub(comment_chars_match, '', model_raw_sql) -%}
|
||||
|
||||
{%- for token, token_cost in var('token_costs').items() -%}
|
||||
|
||||
{# this is not 100% perfect but it checks more or less if the token exists as a word by itself or followed by "("" like for least()/greatest() #}
|
||||
{%- set token_with_boundaries = "\\b" ~ token ~ "[\\t\\r\\n (]" -%}
|
||||
{%- set all_regex_matches = re.findall(token_with_boundaries, model_raw_sql_co_comments, re.IGNORECASE) -%}
|
||||
{%- set all_regex_matches = re.findall(token_with_boundaries, model_raw_sql_no_comments, re.IGNORECASE) -%}
|
||||
{%- set ns.complexity = ns.complexity + token_cost * (all_regex_matches | length) -%}
|
||||
|
||||
{%- endfor -%}
|
||||
|
||||
Reference in New Issue
Block a user