1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

update _snake_case comment

This commit is contained in:
Kelly Brazil
2022-06-15 11:15:26 -07:00
parent c23aacedad
commit b958358389
2 changed files with 3 additions and 5 deletions

View File

@ -236,9 +236,8 @@ def _is_separator(line: str) -> bool:
def _snake_case(line: str) -> str: def _snake_case(line: str) -> str:
""" """
Replace spaces between words and special characters with an underscore Replace spaces between words and special characters with an underscore.
and set to lowercase. Ignore the replacement char (�) used for header Ignore the replacement char (�) used for header padding.
padding.
""" """
line = re.sub(r'[^a-zA-Z0-9� ]', '_', line) # special characters line = re.sub(r'[^a-zA-Z0-9� ]', '_', line) # special characters
line = re.sub(r'\b \b', '_', line) # spaces between words line = re.sub(r'\b \b', '_', line) # spaces between words

View File

@ -242,8 +242,7 @@ def _is_separator(line: str) -> bool:
def _snake_case(line: str) -> str: def _snake_case(line: str) -> str:
""" """
replace spaces between words and special characters with an underscore replace spaces between words and special characters with an underscore.
and set to lowercase
""" """
# must include all column separator characters in regex # must include all column separator characters in regex
line = re.sub(r'[^a-zA-Z0-9 |│┃┆┇┊┋╎╏║]', '_', line) line = re.sub(r'[^a-zA-Z0-9 |│┃┆┇┊┋╎╏║]', '_', line)