Skip to content

Commit 31c5f52

Browse files
committed
Improve morecopyright detection corner cases
Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent 05a3f75 commit 31c5f52

File tree

22 files changed

+69
-46
lines changed

22 files changed

+69
-46
lines changed

src/cluecode/copyrights.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,10 +2102,10 @@ def build_detection_from_node(
21022102
#######################################
21032103
21042104
EMAIL: {<EMAIL_START> <CC> <NN>* <EMAIL_END>} # composite_email
2105-
2105+
21062106
EMAIL: { <NN> <CC> <NN> <DOT> <NN> } # foo at bat dot com
21072107
2108-
2108+
21092109
EMAIL: {<EMAIL> <NN> <EMAIL>} # email or email
21102110
21112111
#######################################
@@ -2557,7 +2557,8 @@ def build_detection_from_node(
25572557
25582558
# Copyright 2015 The Happy Campers
25592559
# Copyright 2015 The Error Prone Authors.
2560-
COPYRIGHT: {<NNP>? <COPY>+ (<YR-RANGE>+ <BY>? <NN>? <COMPANY|NAME|NAME-EMAIL>+ <EMAIL>?)+ <AUTHDOT|MAINT>?} #1630
2560+
# Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic,
2561+
COPYRIGHT: {<NNP>? <COPY>+ (<YR-RANGE>+ <BY>? <NN>? <COMPANY|NAME|NAME-EMAIL|NNP>+ <EMAIL>?)+ <AUTHDOT|MAINT>?} #1630
25612562
25622563
COPYRIGHT: {<COPY>+ <NN> <NAME> <YR-RANGE>} #1650
25632564
@@ -2902,7 +2903,8 @@ def build_detection_from_node(
29022903
29032904
# Copyright (c) All Rights Reserved by the District Export Council of Georgia
29042905
# Copyright (c) by Minds, Japan Council for Quality Health Care
2905-
COPYRIGHT: {<COPY>+ <ALLRIGHTRESERVED> <BY>? <NAME>? <NN>? <NAME|COMPANY>+ } #15674
2906+
# Copyright (C) All Rights Are Reserved. Chungjungwon​. Iotacoffee.Com 2011
2907+
COPYRIGHT: {<COPY>+ <ALLRIGHTRESERVED> <BY>? <NAME>? <NN>? <NAME|COMPANY>+ <YR-RANGE>? } #15674
29062908
29072909
# Copyright (c) All right reserved SSC. Ltd.
29082910
# Copyright (C) All Rights Reserved by Leh. www.leh.jp
@@ -3062,8 +3064,12 @@ def build_detection_from_node(
30623064
30633065
COPYRIGHT: {<COPYRIGHT|COPYRIGHT2|COPY|NAME-COPY> <COPY|NNP|AUTHDOT|CAPS|CD|YR-RANGE|NAME|NAME-EMAIL|NAME-YEAR|NAME-COPY|NAME-CAPS|AUTHORANDCO|COMPANY|YEAR|PN|COMP|UNI|CC|OF|IN|BY|OTH|VAN|URL|EMAIL|URL2|MIXEDCAP|NN>+ <ALLRIGHTRESERVED>} #99999
30643066
3067+
# * Copyright (C) 2004 Red Hat, Inc.
3068+
# * Copyright (C) 200 Matthias Clasen <[email protected]>
3069+
COPYRIGHT: {<COPY> <COPY> <CD> <NAME-EMAIL>} #9999970
3070+
30653071
# <p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice-20000612#Copyright">Copyright</a>
3066-
COPYRIGHT: {<COPYRIGHT> <COPY><COPY>} #9999980
3072+
COPYRIGHT: {<COPYRIGHT> <COPY>} #9999980
30673073
COPYRIGHT: {<COPY|NAME-COPY><COPY|NAME-COPY>} #999990
30683074
COPYRIGHT: {<COPYRIGHT|COPYRIGHT2> <ALLRIGHTRESERVED>} #99900111
30693075
@@ -4100,7 +4106,6 @@ def prepare_text_line(line, dedeb=True, to_ascii=True):
41004106
# keep only one quote
41014107
line = fold_consecutive_quotes(u"'", line)
41024108

4103-
41044109
# treat some escaped literal CR, LF, tabs, \00 as new lines
41054110
# such as in code literals: a="\\n some text"
41064111
line = (line
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
what:
2+
- copyrights
3+
- holders
4+
- holders_summary
5+
- authors
6+
copyrights:
7+
- Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic
8+
holders:
9+
- Xiph.Org, Skype Limited, Octasic
10+
holders_summary:
11+
- value: Xiph.Org, Skype Limited, Octasic
12+
count: 1

tests/cluecode/data/copyrights/transfig_with_parts-transfig.copyright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ copyrights:
1919
- Parts Copyright (c) 2002-2006 by Martin Kroeker
2020
- Copyright 1990, David Koblas
2121
- Copyright, 1987, Massachusetts Institute of Technology
22-
- Copyright (c) 2006 Michael Pfeiffer [email protected]
22+
- Copyright (c) 2006 Michael Pfeiffer - [email protected]
2323
holders:
2424
- Supoj Sutantavibul
2525
- Micah Beck

tests/cluecode/data/ics/bluetooth-glib-gio-xdgmime/xdgmimealias.h.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ what:
44
- holders_summary
55
copyrights:
66
- Copyright (c) 2004 Red Hat, Inc.
7+
- Copyright (c) 200 Matthias Clasen <[email protected]>
78
holders:
89
- Red Hat, Inc.
10+
- Matthias Clasen
911
holders_summary:
1012
- value: Red Hat
1113
count: 1
14+
- value: Matthias Clasen
15+
count: 1
16+

tests/cluecode/data/ics/bluetooth-glib-gobject/gobject.rc.in.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ what:
33
- holders
44
- holders_summary
55
copyrights:
6-
- Copyright (c) 1998-2004 Tim Janik and Red Hat, Inc.
6+
- Copyright (c) 1998-2004 Tim Janik and Red Hat, Inc
77
holders:
8-
- Tim Janik and Red Hat, Inc.
8+
- Tim Janik and Red Hat, Inc
99
holders_summary:
10-
- value: Tim Janik and Red Hat, Inc.
10+
- value: Tim Janik and Red Hat, Inc
1111
count: 1

tests/cluecode/data/ics/chromium-chrome-browser-resources/about_credits.html.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ copyrights:
7070
- Copyright (c) 2001-2002 Thomas Broyer, Charlie Bozeman and Daniel Veillard
7171
- Copyright (c) 1991 Free Software Foundation, Inc.
7272
- copyrighted by the Free Software Foundation
73-
- Copyright (c) 2005, 2006 Nick Galbreath
73+
- Copyright (c) 2005, 2006 Nick Galbreath - nickg at modp dot com
7474
- Copyright 2008 MolokoCacao
7575
- Copyright (c) 2004-2009 Sergey Lyubka
7676
- Portions Copyright (c) 2009 Gilbert Wellisch
@@ -175,7 +175,7 @@ holders:
175175
- Thomas Broyer, Charlie Bozeman and Daniel Veillard
176176
- Free Software Foundation, Inc.
177177
- the Free Software Foundation
178-
- Nick Galbreath
178+
- Nick Galbreath - nickg at modp dot com
179179
- MolokoCacao
180180
- Sergey Lyubka
181181
- Gilbert Wellisch
@@ -318,7 +318,7 @@ holders_summary:
318318
count: 1
319319
- value: Nara Institute of Science and Technology
320320
count: 1
321-
- value: Nick Galbreath
321+
- value: Nick Galbreath - nickg at modp dot com
322322
count: 1
323323
- value: Niels Provos
324324
count: 1

tests/cluecode/data/ics/chromium-third_party-modp_b64/LICENSE.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ what:
33
- holders
44
- holders_summary
55
copyrights:
6-
- Copyright (c) 2005, 2006 Nick Galbreath nickg at modp dot com
6+
- Copyright (c) 2005, 2006 Nick Galbreath - nickg at modp dot com
77
holders:
8-
- Nick Galbreath nickg at modp dot com
8+
- Nick Galbreath - nickg at modp dot com
99
holders_summary:
10-
- value: Nick Galbreath nickg at modp dot com
10+
- value: Nick Galbreath - nickg at modp dot com
1111
count: 1

tests/cluecode/data/ics/chromium-third_party-modp_b64/modp_b64.cc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ what:
33
- holders
44
- holders_summary
55
copyrights:
6-
- Copyright (c) 2005, 2006 Nick Galbreath nickg at modp dot com
6+
- Copyright (c) 2005, 2006 Nick Galbreath - nickg at modp dot com
77
holders:
8-
- Nick Galbreath nickg at modp dot com
8+
- Nick Galbreath - nickg at modp dot com
99
holders_summary:
10-
- value: Nick Galbreath nickg at modp dot com
10+
- value: Nick Galbreath - nickg at modp dot com
1111
count: 1

tests/cluecode/data/ics/chromium-third_party-modp_b64/modp_b64.h.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ what:
33
- holders
44
- holders_summary
55
copyrights:
6-
- Copyright (c) 2005, 2006, Nick Galbreath nickg at modp dot com
6+
- Copyright (c) 2005, 2006, Nick Galbreath - nickg at modp dot com
77
holders:
8-
- Nick Galbreath nickg at modp dot com
8+
- Nick Galbreath - nickg at modp dot com
99
holders_summary:
10-
- value: Nick Galbreath nickg at modp dot com
10+
- value: Nick Galbreath - nickg at modp dot com
1111
count: 1

0 commit comments

Comments
 (0)