Skip to content

Commit

Permalink
Fixed issue with is_snake_case regex
Browse files Browse the repository at this point in the history
  • Loading branch information
rbob86 committed Mar 31, 2023
1 parent c8e3272 commit 698ca56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion linter/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ def pascal_case_to_snake_case(pascal_case: str) -> str:


def is_snake_case(name: str) -> bool:
pattern = compile(r'^[a-z][a-z0-9]+(_[a-z0-9]+)*$')
pattern = compile(r'^[a-z0-9]+(_[a-z0-9]+)*$')
return pattern.match(name) is not None
2 changes: 1 addition & 1 deletion test/rules/test_field_name_is_snake_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def test_run_method_successfully_validates_field_name_is_snake_case() -> None:
rule = FieldNameIsSnakeCase(Severity.ERROR.value)

field = {
'name': 'order_id',
'name': 't_order_id',
'primary_key': 'yes',
'sql': '${TABLE}.ORDER_ID',
'type': 'number',
Expand Down

0 comments on commit 698ca56

Please sign in to comment.