Skip to content

Commit

Permalink
update regex_comments string in check-script-has-no-table-name (dbt-c…
Browse files Browse the repository at this point in the history
…heckpoint#47)

* update regex_comments string
  • Loading branch information
neddonaldson authored Jan 27, 2022
1 parent 648a1e1 commit cc144b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pre_commit_dbt/check_script_has_no_table_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pre_commit_dbt.utils import add_filenames_args

REGEX_COMMENTS = (
r"((\/\*|\{#)([^*]|[\r\n]|([\*#]+([^*\/#]|[\r\n])))*(\*+\/|#\})|[ \t]*--.*)"
r"(?<=(\/\*|\{#))((.|[\r\n])+?)(?=(\*+\/|#\}))|[ \t]*--.*"
)
REGEX_SPLIT = r"[\s]+"
IGNORE_WORDS = ["", "(", "{{"] # pragma: no mutate
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_check_script_has_no_table_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def test_replace_comments():
sql = "--- select * from ee"
assert replace_comments(sql) == ""
sql = "/* select * from ee*/"
assert replace_comments(sql) == ""
assert replace_comments(sql) == "" or replace_comments(sql) == "/**/"


def test_prev_cur_next_iter():
Expand Down

0 comments on commit cc144b9

Please sign in to comment.