Skip to content

Commit 5db9d05

Browse files
authored
Merge pull request #2666 from nexB/improve-copyright-detection
Do not mistake path for copyright year
2 parents 3a82423 + 5efea66 commit 5db9d05

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/cluecode/copyrights.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ def from_node(
516516
# COPYRIGHT
517517
############################################################################
518518

519-
# first some exceptions
519+
# some exceptions
520520

521521
# NOT a copyright Copyright.txt : treat as NN
522522
(r'^Copyright\.txt$', 'NN'),
@@ -581,6 +581,10 @@ def from_node(
581581
# JUNK are things to ignore
582582
############################################################################
583583

584+
# path with trailing year-like are NOT a year as in
585+
# Landroid/icu/impl/IDNA2003 : treat as JUNK
586+
(r'^[^\\/]+[\\/][^\\/]+[\\/].*$', 'JUNK'),
587+
584588
# Combo of many (3+) letters and punctuations groups without spaces is likely junk
585589
# "AEO>>,o>>'!xeoI?o?O1/4thuA/"
586590
# (r'((\w+\W+){3,})+', 'JUNK'),
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Landroid/icu/impl/IDNA2003;->startsWithPrefix(Ljava/lang/StringBuffer;)Z,BLACK
2+
Landroid/icu/impl/IDNA2003;->toASCIILower(C)C,BLACK
3+
Landroid/icu/impl/IDNA2003;->toASCIILower(Ljava/lang/CharSequence;)Ljava/lang/StringBuffer;,BLACK
4+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
what:
2+
- copyrights

0 commit comments

Comments
 (0)