Skip to content

Commit 9139681

Browse files
committed
Improve copyright detection
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent db79e7a commit 9139681

File tree

11 files changed

+56
-12
lines changed

11 files changed

+56
-12
lines changed

src/cluecode/copyrights.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ def build_detection_from_node(
14831483
(r'^Initials$', 'NN'),
14841484
(r'^Licen[cs]e', 'NN'),
14851485
(r'^License-Alias\:?$', 'NN'),
1486-
(r'^Linux$', 'NN'),
1486+
(r'^Linux$', 'LINUX'),
14871487
(r'^Locker$', 'NN'),
14881488
(r'^Log$', 'NN'),
14891489
(r'^Logos?$', 'NN'),
@@ -1788,6 +1788,8 @@ def build_detection_from_node(
17881788
(r'werkstaetten\.?$', 'NNP'),
17891789
(r'werken$', 'NNP'),
17901790
(r'various\.?$', 'NNP'),
1791+
(r'SuSE$', 'COMPANY'),
1792+
(r'Suse$', 'COMPANY'),
17911793

17921794
# treat Attributable as proper noun as it is seen in Author tags such as in:
17931795
# @author not attributable
@@ -1869,6 +1871,8 @@ def build_detection_from_node(
18691871
# More company suffix : a.s. in Czechia and otehrs
18701872
(r'^(a\.s\.|S\.r\.l\.?)$', 'COMP'),
18711873
(r'^Vertriebsges\.m\.b\.H\.?,?$', 'COMP'),
1874+
# Iceland
1875+
(r'^(ehf|hf|svf|ohf)\.,?$', 'COMP'),
18721876

18731877
# company suffix : AS: this is frequent beyond Norway.
18741878
(r'^AS', 'CAPS'),
@@ -2408,7 +2412,7 @@ def build_detection_from_node(
24082412
# Project contributors
24092413
COMPANY: {<COMP> <CONTRIBUTORS>} #256
24102414
2411-
COMPANY: {<COMP>+} #260
2415+
COMPANY: {<LINUX>? <COMP>+} #260
24122416
24132417
# Nokia Corporation and/or its subsidiary(-ies)
24142418
COMPANY: {<COMPANY> <CC> <NN> <COMPANY>} #265
@@ -2505,7 +2509,7 @@ def build_detection_from_node(
25052509
# Copyright 2018, OpenCensus Authors
25062510
COPYRIGHT: {<COPY>+ <YR-RANGE> <NNP> <AUTHS>} #1579991
25072511
2508-
NAME-YEAR: {<YR-RANGE> <NNP>+ <CAPS>?} #5612
2512+
NAME-YEAR: {<YR-RANGE> <NNP>+ <CAPS>? <LINUX>?} #5612
25092513
25102514
#Academy of Motion Picture Arts and Sciences
25112515
NAME: {<NAME> <CC> <NNP>} #561
@@ -2889,7 +2893,7 @@ def build_detection_from_node(
28892893
COPYRIGHT: {<COPY>+ <YR-RANGE> <CONTRIBUTORS> <ALLRIGHTRESERVED>?} #22791
28902894
28912895
# Copyright 1996, 1997 Linux International.
2892-
COPYRIGHT: {<COPY>+ <YR-RANGE> <NN> <NNP>} #22792
2896+
COPYRIGHT: {<COPY>+ <YR-RANGE> <LINUX|NN> <NNP>} #22792
28932897
28942898
# Copyright (C) 2001-2008 the LGPL VGABios developers Team
28952899
COPYRIGHT: {<COPY> <COPY> <YR-RANGE> <COMPANY>} #22793.1
@@ -2917,7 +2921,7 @@ def build_detection_from_node(
29172921
COPYRIGHT: {<COPY> <YR-RANGE> <COPY> <NNP>} #230020
29182922
29192923
# Copyright (C) 1999-2000 VA Linux Systems
2920-
COPYRIGHT: {<COPY> <COPY> <YR-RANGE> <CAPS> <NN> <NNP>} #2280-1
2924+
COPYRIGHT: {<COPY> <COPY> <YR-RANGE> <CAPS> <NN|LINUX> <NNP>} #2280-1
29212925
29222926
COPYRIGHT2: {<COPY>+ <NN|CAPS>? <YR-RANGE>+ <PN>*} #2280
29232927
@@ -3037,7 +3041,7 @@ def build_detection_from_node(
30373041
COPYRIGHT: {<COPY> <PN>? <YR-RANGE> <BY> <NN> <NAME>} #2007
30383042
30393043
# Copyright (C) 2005 SUSE Linux Products GmbH.
3040-
COPYRIGHT: {<COPYRIGHT2> <CAPS> <NN> <COMPANY>} #2008
3044+
COPYRIGHT: {<COPYRIGHT2> <CAPS|COMPANY> <NN|LINUX> <COMPANY>} #2008
30413045
30423046
# Copyright (c) 2016-2018 JSR 371 expert group and contributors
30433047
COPYRIGHT: {<COPYRIGHT2> <CAPS> <CD> <COMPANY> <NAME>} #2009.1

src/licensedcode/data/licenses/ldpl-2.0.LICENSE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ homepage_url: http://tldp.org/COPYRIGHT.html
88
spdx_license_key: LicenseRef-scancode-ldpl-2.0
99
text_urls:
1010
- http://linuxmafia.com/faq/Licensing_and_Law/ldp-license-2.0.html
11-
ignorable_copyrights:
12-
- copyright to each Linux Documentation Project
1311
ignorable_emails:
1412
- guylhem@metalab.unc.edu
15-
ignorable_holders:
16-
- each Linux Documentation Project
1713
ignorable_urls:
1814
- http://sunsite.unc.edu/LDP
1915
---

tests/cluecode/data/copyrights/misco4/linux4/wing.txt.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ what:
33
- holders
44
- authors
55
copyrights:
6-
- Copyright (c) 2009 Wing
6+
- Copyright (c) 2009 Wing Linux
77
holders:
8-
- Wing
8+
- Wing Linux
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Copyright (c) 2007, 2010 Linux Foundation
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) 2007, 2010 Linux Foundation
7+
holders:
8+
- Linux Foundation
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Copyright (c) 2004 SuSE Linux AG, Nuernberg, Germany
2+
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) 2004 SuSE Linux AG, Nuernberg, Germany
7+
holders:
8+
- SuSE Linux AG, Nuernberg, Germany
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Copyright (c) 2003, 2006 SuSE Linux AG.
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) 2003, 2006 SuSE Linux AG.
7+
holders:
8+
- SuSE Linux AG.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Copyright 2002, 2003, 2004 SuSE Linux AG, Germany
2+
Copyright 2005, 2008, 2009 2011 SUSE LINUX Products GmbH, Germany
3+
Copyright 2015 Björn Esser
4+

0 commit comments

Comments
 (0)