diff --git a/src/cluecode/copyrights.py b/src/cluecode/copyrights.py index 443f45f8367..0caf90d2b9f 100644 --- a/src/cluecode/copyrights.py +++ b/src/cluecode/copyrights.py @@ -516,7 +516,7 @@ def from_node( # COPYRIGHT ############################################################################ - # first some exceptions + # some exceptions # NOT a copyright Copyright.txt : treat as NN (r'^Copyright\.txt$', 'NN'), @@ -581,6 +581,10 @@ def from_node( # JUNK are things to ignore ############################################################################ + # path with trailing year-like are NOT a year as in + # Landroid/icu/impl/IDNA2003 : treat as JUNK + (r'^[^\\/]+[\\/][^\\/]+[\\/].*$', 'JUNK'), + # Combo of many (3+) letters and punctuations groups without spaces is likely junk # "AEO>>,o>>'!xeoI?o?O1/4thuA/" # (r'((\w+\W+){3,})+', 'JUNK'), diff --git a/tests/cluecode/data/copyrights/year-like-path.txt b/tests/cluecode/data/copyrights/year-like-path.txt new file mode 100644 index 00000000000..4c30fb1e2fc --- /dev/null +++ b/tests/cluecode/data/copyrights/year-like-path.txt @@ -0,0 +1,4 @@ +Landroid/icu/impl/IDNA2003;->startsWithPrefix(Ljava/lang/StringBuffer;)Z,BLACK +Landroid/icu/impl/IDNA2003;->toASCIILower(C)C,BLACK +Landroid/icu/impl/IDNA2003;->toASCIILower(Ljava/lang/CharSequence;)Ljava/lang/StringBuffer;,BLACK + diff --git a/tests/cluecode/data/copyrights/year-like-path.txt.yml b/tests/cluecode/data/copyrights/year-like-path.txt.yml new file mode 100644 index 00000000000..52c76a12981 --- /dev/null +++ b/tests/cluecode/data/copyrights/year-like-path.txt.yml @@ -0,0 +1,2 @@ +what: + - copyrights