Skip to content

Commit 6d2320c

Browse files
authored
Merge pull request #2707 from nexB/copyright-fixes
Improve Copyright detection
2 parents e30dfe6 + 8d2cb1b commit 6d2320c

13 files changed

+91
-2
lines changed

spdx-copy.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# SPDX-FileCopyrightText: Copyright 2019-2021 Test Inc.
3+
# SPDX-FileCopyrightText: Copyright (c) SOIM
4+
#
5+
# SPDX-License-Identifier: GPL-3.0
6+
7+
import os

spdx-copy.txt.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
what:
2+
- copyrights
3+
copyrights:
4+
- Copyright 2019-2021 Test Inc.
5+
- Copyright (c) SOIM

src/cluecode/copyrights.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ def from_node(
617617
(r'^Agreement$', 'JUNK'),
618618
(r'^Usage$', 'JUNK'),
619619
(r'^Please$', 'JUNK'),
620-
(r'^Based$', 'JUNK'),
620+
(r'^\(?Based$', 'JUNK'),
621621
(r'^Upstream$', 'JUNK'),
622622
(r'^Files?$', 'JUNK'),
623623
(r'^Filename:?$', 'JUNK'),
@@ -1140,6 +1140,7 @@ def from_node(
11401140
(r'^The$', 'NN'),
11411141
(r'^THE', 'NN'),
11421142
(r'^These$', 'NN'),
1143+
(r'^[tT]here$', 'NN'),
11431144
(r'^This$', 'NN'),
11441145
(r'^THIS$', 'NN'),
11451146
(r'^Those$', 'NN'),
@@ -2217,7 +2218,8 @@ def from_node(
22172218
COPYRIGHT: {<COPY>+ <YR-RANGE> <NN> <NNP>} #22792
22182219
22192220
# Copyright (c) 2017 odahcam
2220-
COPYRIGHT: {<COPY>+ <YR-RANGE> <NN>+ <ALLRIGHTRESERVED>?} #22793
2221+
# or Copyright (c) 2019-2021, Open source contributors.
2222+
COPYRIGHT: {<COPY>+ <YR-RANGE> <NN>+ <CONTRIBUTORS>? <ALLRIGHTRESERVED>?} #22793
22212223
22222224
# Licensed material of Foobar Company, All Rights Reserved, (C) 2005
22232225
COPYRIGHT: {<COMPANY> <ALLRIGHTRESERVED> <COPYRIGHT>} #22794
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Copyright 2018-2019 @paritytech/substrate-light-ui authors & contributors
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
what:
2+
- copyrights
3+
copyrights:
4+
- Copyright 2018-2019 paritytech/substrate-light-ui authors & contributors
5+
6+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Copyright (c) 2015, Contributors
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
what:
2+
- copyrights
3+
copyrights:
4+
- Copyright (c) 2015, Contributors
5+
6+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# order to be recognized. For example, each of these is fine:
2+
#
3+
# Copyright @copyright{} 1990-2005, 2007-2009 Free Software
4+
# Foundation, Inc.
5+
#
6+
# # Copyright (C) 1990-2005, 2007-2009 Free Software
7+
# # Foundation, Inc.
8+
#
9+
# /*
10+
# * Copyright &copy; 90,2005,2007-2009
11+
# * Free Software Foundation, Inc.
12+
# */
13+
#
14+
# However, the following format is not recognized because the line
15+
# prefix changes after the first line:
16+
#
17+
# ## Copyright (C) 1990-2005, 2007-2009 Free Software
18+
# # Foundation, Inc.
19+
#
20+
# However, any correctly formatted copyright statement following
21+
# a non-matching copyright statements would be recognized.
22+
#
23+
# 2. Its format is "Copyright (C)", then a list of copyright years,
24+
# and then the name of the copyright holder.
25+
# 3. The "(C)" takes one of the following forms or is omitted
26+
# entirely:
27+
#
28+
# A. (C)
29+
# B. (c)
30+
# C. @copyright{}
31+
# D. &copy;
32+
# E. ©
33+
#
34+
# 4. The "Copyright" appears at the beginning of a line, except that it
35+
# may be prefixed by any sequence (e.g., a comment) of no more than
36+
# 5 characters -- including white space.
37+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
what:
2+
- copyrights
3+
copyrights:
4+
- Copyright 1990-2005, 2007-2009 Free Software Foundation, Inc.
5+
- Copyright (c) 1990-2005, 2007-2009 Free Software Foundation, Inc.
6+
- Copyright (c) 90,2005,2007-2009 Free Software Foundation, Inc.
7+
- Copyright (c) 1990-2005, 2007-2009 Free Software Foundation, Inc.
8+
- A. (c) B. (c)
9+
- C. copyright D. (c)
10+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Copyright (c) 2019-2021, Open source contributors.

0 commit comments

Comments
 (0)