Skip to content

Commit 1766aa6

Browse files
committed
fix failing test cases
1 parent 0c814dc commit 1766aa6

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/cluecode/copyrights.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -428,22 +428,18 @@ 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("',")
432-
433-
# remove leading plus sign
434-
if tok.startswith('+'):
435-
tok = tok.lstrip('+')
436-
437-
# convert 'AUTHOR:' to 'author:' or 'Author:'
438-
if tok == 'AUTHOR:':
439-
tok = 'author:'
431+
tok = tok.rstrip("',")
440432

441433
tok = (
442434
tok
443435
.strip("' ") # strip leading and trailing single quotes, and spaces
444436
.rstrip(':') # strip trailing colons
445437
.strip()
446438
)
439+
440+
# convert '+AUTHOR' to ('author' or 'Author')
441+
if tok == '+AUTHOR':
442+
tok = 'author'
447443

448444
# Split tokens like 'Author:Frankie.Chu' into 'Author' and 'Frankie.Chu'
449445
if tok.startswith("Author:"):

0 commit comments

Comments
 (0)