Skip to content

Commit af9a991

Browse files
committed
Fix detection of copyright holders
* There is a copyright notice in `src/crypto/sha256_sse4.cpp` in the middle of the file which contains a comma before the copyright holder name. Correctly detect this so it's added to the report. * Add missing copyright holders so that `copyright_header.py report` doesn't show any unexpected copyright holder names anymore. * Exclude files from git subtrees because they are maintained at the original source.
1 parent 708cbb1 commit af9a991

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

contrib/devtools/copyright_header.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,32 @@
1515
################################################################################
1616

1717
EXCLUDE = [
18-
# libsecp256k1:
19-
'src/secp256k1/include/secp256k1.h',
20-
'src/secp256k1/include/secp256k1_ecdh.h',
21-
'src/secp256k1/include/secp256k1_recovery.h',
22-
'src/secp256k1/include/secp256k1_schnorr.h',
23-
'src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c',
24-
'src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h',
25-
'src/secp256k1/src/java/org_bitcoin_Secp256k1Context.c',
26-
'src/secp256k1/src/java/org_bitcoin_Secp256k1Context.h',
27-
# univalue:
28-
'src/univalue/test/object.cpp',
29-
'src/univalue/lib/univalue_escapes.h',
3018
# auto generated:
3119
'src/qt/bitcoinstrings.cpp',
3220
'src/chainparamsseeds.h',
3321
# other external copyrights:
3422
'src/tinyformat.h',
35-
'src/leveldb/util/env_win.cc',
36-
'src/crypto/ctaes/bench.c',
3723
'test/functional/test_framework/bignum.py',
3824
# python init:
3925
'*__init__.py',
4026
]
4127
EXCLUDE_COMPILED = re.compile('|'.join([fnmatch.translate(m) for m in EXCLUDE]))
4228

29+
EXCLUDE_DIRS = [
30+
# git subtrees
31+
"src/crypto/ctaes/",
32+
"src/leveldb/",
33+
"src/secp256k1/",
34+
"src/univalue/",
35+
]
36+
4337
INCLUDE = ['*.h', '*.cpp', '*.cc', '*.c', '*.py']
4438
INCLUDE_COMPILED = re.compile('|'.join([fnmatch.translate(m) for m in INCLUDE]))
4539

4640
def applies_to_file(filename):
41+
for excluded_dir in EXCLUDE_DIRS:
42+
if filename.startswith(excluded_dir):
43+
return False
4744
return ((EXCLUDE_COMPILED.match(filename) is None) and
4845
(INCLUDE_COMPILED.match(filename) is not None))
4946

@@ -81,7 +78,7 @@ def get_filenames_to_examine():
8178
ANY_COPYRIGHT_COMPILED = re.compile(ANY_COPYRIGHT_STYLE_OR_YEAR_STYLE)
8279

8380
def compile_copyright_regex(copyright_style, year_style, name):
84-
return re.compile('%s %s %s' % (copyright_style, year_style, name))
81+
return re.compile('%s %s,? %s' % (copyright_style, year_style, name))
8582

8683
EXPECTED_HOLDER_NAMES = [
8784
"Satoshi Nakamoto\n",
@@ -107,6 +104,9 @@ def compile_copyright_regex(copyright_style, year_style, name):
107104
"Jan-Klaas Kollhof\n",
108105
"Sam Rushing\n",
109106
"ArtForz -- public domain half-a-node\n",
107+
"Intel Corporation",
108+
"The Zcash developers",
109+
"Jeremy Rubin",
110110
]
111111

112112
DOMINANT_STYLE_COMPILED = {}

0 commit comments

Comments
 (0)