Skip to content

Commit ba71a78

Browse files
committed
remove leading plus sign from token
1 parent a01a7cb commit ba71a78

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/cluecode/copyrights.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,11 @@ def get_tokens(numbered_lines, splitter=re.compile(r'[\t =;]+').split):
428428
for tok in splitter(line):
429429
# strip trailing quotes+comma
430430
if tok.endswith("',"):
431-
tok = tok.rstrip("',")
431+
tok = tok.rstrip("',")
432+
433+
# remove leading plus sign
434+
if tok.startswith('+'):
435+
tok = tok.lstrip('+')
432436

433437
tok = (
434438
tok
@@ -437,8 +441,8 @@ def get_tokens(numbered_lines, splitter=re.compile(r'[\t =;]+').split):
437441
.strip()
438442
)
439443

440-
# convert '+AUTHOR' to ('author' or 'Author')
441-
if tok == '+AUTHOR':
444+
# convert 'AUTHOR' to ('author' or 'Author')
445+
if tok == 'AUTHOR':
442446
tok = 'author'
443447

444448
# Split tokens like 'Author:Frankie.Chu' into 'Author' and 'Frankie.Chu'

0 commit comments

Comments
 (0)