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:
@ -236,9 +236,8 @@ def _is_separator(line: str) -> bool:
|
||||
|
||||
def _snake_case(line: str) -> str:
|
||||
"""
|
||||
Replace spaces between words and special characters with an underscore
|
||||
and set to lowercase. Ignore the replacement char (�) used for header
|
||||
padding.
|
||||
Replace spaces between words and special characters with an underscore.
|
||||
Ignore the replacement char (�) used for header padding.
|
||||
"""
|
||||
line = re.sub(r'[^a-zA-Z0-9� ]', '_', line) # special characters
|
||||
line = re.sub(r'\b \b', '_', line) # spaces between words
|
||||
|
@ -242,8 +242,7 @@ def _is_separator(line: str) -> bool:
|
||||
|
||||
def _snake_case(line: str) -> str:
|
||||
"""
|
||||
replace spaces between words and special characters with an underscore
|
||||
and set to lowercase
|
||||
replace spaces between words and special characters with an underscore.
|
||||
"""
|
||||
# must include all column separator characters in regex
|
||||
line = re.sub(r'[^a-zA-Z0-9 |│┃┆┇┊┋╎╏║]', '_', line)
|
||||
|
Reference in New Issue
Block a user