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:
|
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
|
||||||
|
@ -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)
|
||||||
|
Reference in New Issue
Block a user