Skip to content

Commit 9aaf1b1

Browse files
committed
Improve license detection more
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 0af2fe4 commit 9aaf1b1

File tree

12 files changed

+44
-27
lines changed

12 files changed

+44
-27
lines changed

src/cluecode/copyrights.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,7 +2152,10 @@ def build_detection_from_node(
21522152
(r'^\$?date-of-software$', 'YR'),
21532153
(r'^\$?date-of-document$', 'YR'),
21542154

2155-
# cardinal numbers
2155+
# small-cardinal numbers, under 30
2156+
(r'^[0-3]?[0-9]?[\.,]?$', 'CDS'),
2157+
2158+
# all other cardinal numbers
21562159
(r'^-?[0-9]+(.[0-9]+)?[\.,]?$', 'CD'),
21572160

21582161
############################################################################
@@ -2330,19 +2333,19 @@ def build_detection_from_node(
23302333
23312334
YR-RANGE: {<YR>+ <CC>+ <YR>} #20
23322335
YR-RANGE: {<YR> <DASH|TO>* <YR|BARE-YR>+} #30
2333-
YR-RANGE: {<CD|BARE-YR>? <YR> <BARE-YR>?} #40
2336+
YR-RANGE: {<CD|CDS|BARE-YR>? <YR> <BARE-YR>?} #40
23342337
YR-RANGE: {<YR>+ <BARE-YR>? } #50
23352338
YR-AND: {<CC>? <YR>+ <CC>+ <YR>} #60
23362339
YR-RANGE: {<YR-AND>+} #70
23372340
YR-RANGE: {<YR-RANGE>+ <DASH|TO> <YR-RANGE>+} #71
23382341
YR-RANGE: {<YR-RANGE>+ <DASH>?} #72
23392342
# Copyright (c) 1999, 2000, 01, 03, 06 Ralf Baechle
2340-
YR-RANGE: {<YR-RANGE> <CD>+} #72.2
2343+
YR-RANGE: {<YR-RANGE> <CD|CDS>+} #72.2
23412344
23422345
CD: {<BARE-YR>} #bareyear
23432346
23442347
# 5 Jan 2003
2345-
YR-RANGE: {<CD> <NNP> <YR-RANGE>} #72.3
2348+
YR-RANGE: {<CDS> <NNP> <YR-RANGE>} #72.3
23462349
23472350
23482351
#######################################
@@ -2437,8 +2440,9 @@ def build_detection_from_node(
24372440
# AT&T Laboratories, Cambridge
24382441
COMPANY: {<COMP> <COMP> <NNP>} #145
24392442
2443+
COMPANY: {<COMP> <CD|CDS> <COMP>} #170
2444+
24402445
# rare "Software in the public interest, Inc."
2441-
COMPANY: {<COMP> <CD> <COMP>} #170
24422446
COMPANY: {<NNP> <IN><NN> <NNP> <NNP>+<COMP>?} #180
24432447
24442448
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
@@ -2613,7 +2617,7 @@ def build_detection_from_node(
26132617
26142618
URL: {<PARENS> <URL> <PARENS>} #5700
26152619
2616-
NAME-YEAR: {<NAME-YEAR> <CD> <NNP>} #5700.1
2620+
NAME-YEAR: {<NAME-YEAR> <CDS> <NNP>} #5700.1
26172621
26182622
#also accept trailing email and URLs
26192623
# and "VAN" e.g. Du: Copyright (c) 2008 Alek Du <alek.du@intel.com>
@@ -2625,7 +2629,7 @@ def build_detection_from_node(
26252629
NAME: {<NN|NNP|CAPS>+ <CC> <OTH>} #600
26262630
NAME: {<NNP> <CAPS>} #610
26272631
NAME: {<CAPS> <DASH>? <NNP|NAME>} #620
2628-
NAME: {<NNP> <CD> <NNP>} #630
2632+
NAME: {<NNP> <CD|CDS> <NNP>} #630
26292633
NAME: {<COMP> <NAME>+} #640
26302634
26312635
# Copyright 2018-2019 @paritytech/substrate-light-ui authors & contributors
@@ -3144,7 +3148,7 @@ def build_detection_from_node(
31443148
COPYRIGHT: {<COPYRIGHT2> <CAPS|COMPANY> <NN|LINUX> <COMPANY>} #2008
31453149
31463150
# Copyright (c) 2016-2018 JSR 371 expert group and contributors
3147-
COPYRIGHT: {<COPYRIGHT2> <CAPS> <CD> <COMPANY> <NAME>} #2009.1
3151+
COPYRIGHT: {<COPYRIGHT2> <CAPS> <CD|CDS> <COMPANY> <NAME>} #2009.1
31483152
31493153
# COPYRIGHT (c) 2006 - 2009 DIONYSOS
31503154
COPYRIGHT: {<COPYRIGHT2> <CAPS>} #2009
@@ -3273,7 +3277,7 @@ def build_detection_from_node(
32733277
COPYRIGHT: {<COPY> <NNP> <NAME-YEAR> <COMPANY>?} #15720
32743278
32753279
# Copyright (c) 2008-1010 Intel Corporation
3276-
COPYRIGHT: {<COPY> <COPY> <CD> <COMPANY>} #rare-cd-not-year
3280+
COPYRIGHT: {<COPY> <COPY> <CD|CDS> <COMPANY>} #rare-cd-not-year
32773281
32783282
# Copyright (C) 2005-2006 dann frazier <dannf@dannf.org>
32793283
COPYRIGHT: {<COPYRIGHT2> <NN> <NN> <EMAIL>} #999991
@@ -3461,11 +3465,11 @@ def build_detection_from_node(
34613465
34623466
COPYRIGHT: {<COMPANY><COPY>+<ALLRIGHTRESERVED>} #99900
34633467
3464-
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
3468+
COPYRIGHT: {<COPYRIGHT|COPYRIGHT2|COPY|NAME-COPY> <COPY|NNP|AUTHDOT|CAPS|CD|CDS|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
34653469
34663470
# * Copyright (C) 2004 Red Hat, Inc.
34673471
# * Copyright (C) 200 Matthias Clasen <mclasen@redhat.com>
3468-
COPYRIGHT: {<COPY> <COPY> <CD> <NAME-EMAIL>} #9999970
3472+
COPYRIGHT: {<COPY> <COPY> <CD|CDS> <NAME-EMAIL>} #9999970
34693473
34703474
# <p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice-20000612#Copyright">Copyright</a>
34713475
COPYRIGHT: {<COPYRIGHT> <COPY>} #9999980

src/licensedcode/data/licenses/array-input-method-pl.LICENSE

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ ignorable_copyrights:
1111
- copyright holder of Array Input Method
1212
ignorable_holders:
1313
- Array Input Method
14-
ignorable_authors:
15-
- Array Input
1614
---
1715

1816
Array Input Method Public License
@@ -80,4 +78,4 @@ or other liability obligations and/or rights consistent with this License. Howev
8078
obligations, licensee may act only on his own behalf and on his sole responsibility, not on behalf of
8179
anyone else, and only if the licensee agrees toindemnify, defend, and hold everyone else harmless
8280
for any liability incurred by, or claims asserted against, such everyone else by reason of licensee's
83-
accepting any such warranty or additional liability.
81+
accepting any such warranty or additional liability.

src/licensedcode/data/licenses/wxwidgets.LICENSE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ text_urls:
1010
- http://www.wxwidgets.org/about/licence.htm
1111
ignorable_copyrights:
1212
- Copyright (c) 1997 Julian Smart, Markus Holzem
13-
- copyrighted by the wxWidgets
13+
- copyrighted by the wxWidgets authors
1414
ignorable_holders:
1515
- Julian Smart, Markus Holzem
16-
- the wxWidgets
16+
- the wxWidgets authors
1717
ignorable_emails:
1818
- julian@wxwidgets.org
1919
---
@@ -238,4 +238,4 @@ library for tweaking knobs) written by James Random Hacker.
238238

239239
<signature of Ty Coon>, 1 April 1990
240240

241-
Ty Coon, President of Vice
241+
Ty Coon, President of Vice

src/licensedcode/data/rules/apache-1.1_114.RULE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ ignorable_holders:
1010
- Leo Galambos
1111
ignorable_authors:
1212
- the Egothor Project
13-
- the Egothor Project. Under
1413
ignorable_urls:
1514
- http://egothor.sf.net/
1615
ignorable_emails:
@@ -71,4 +70,4 @@ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
7170
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
7271
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
7372
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
74-
OF THE POSSIBILITY OF SUCH DAMAGE.
73+
OF THE POSSIBILITY OF SUCH DAMAGE.

tests/cluecode/data/copyrights/misco2/mmiv.txt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ what:
44
- holders_summary
55
- authors
66
copyrights:
7-
- Copyright (c) MMIV-MMV Anselm R. Garbe
7+
- Copyright (c) MMIV-MMV Anselm R. Garbe garbeam at gmail dot com
88
holders:
99
- MMIV-MMV Anselm R. Garbe
1010
holders_summary:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Copyright 2016 Tom aan de Wiel
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
what:
2+
- copyrights
3+
- holders
4+
- authors
5+
copyrights:
6+
- Copyright 2016 Tom aan de Wiel
7+
holders:
8+
- Tom aan de Wiel
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Copyright (c) 1989 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
what:
2+
- copyrights
3+
- holders
4+
- authors
5+
copyrights:
6+
- Copyright (c) 1989 Free Software Foundation, Inc.
7+
holders:
8+
- Free Software Foundation, Inc.

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ copyrights:
6868
- Copyright (c) 1998-2003 Daniel Veillard
6969
- Copyright (c) 2001-2002 Daniel Veillard
7070
- Copyright (c) 2001-2002 Thomas Broyer, Charlie Bozeman and Daniel Veillard
71-
- Copyright (c) 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA
71+
- Copyright (c) 1991 Free Software Foundation, Inc.
7272
- copyrighted by the Free Software Foundation
7373
- Copyright (c) 2005, 2006 Nick Galbreath - nickg at modp dot com
7474
- Copyright 2008 MolokoCacao
@@ -173,7 +173,7 @@ holders:
173173
- Daniel Veillard
174174
- Daniel Veillard
175175
- Thomas Broyer, Charlie Bozeman and Daniel Veillard
176-
- Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA
176+
- Free Software Foundation, Inc.
177177
- the Free Software Foundation
178178
- Nick Galbreath
179179
- MolokoCacao
@@ -219,7 +219,7 @@ holders_summary:
219219
- value: Google
220220
count: 11
221221
- value: Free Software Foundation
222-
count: 7
222+
count: 8
223223
- value: the Initial Developer
224224
count: 6
225225
- value: Glenn Randers-Pehrson
@@ -278,8 +278,6 @@ holders_summary:
278278
count: 1
279279
- value: Expat maintainers
280280
count: 1
281-
- value: Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA
282-
count: 1
283281
- value: Giampaolo Rodola
284282
count: 1
285283
- value: Gilbert Wellisch

0 commit comments

Comments
 (0)