Skip to content

Commit a7dc032

Browse files
author
MarcoFalke
committed
Merge #14785: Scripts: Fix detection of copyright holders
af9a991 Fix detection of copyright holders (Cornelius Schumacher) Pull request description: Fix copyright holder detection so that `copyright_header.py report` creates a clean and accurate report: * Fix list of copyright holders in the code * Also detect copyrights which have a comma after the date * Exclude directories which are git subtrees Tree-SHA512: 7ab78618aa62c7d40b6688ddcde4a85c6fc5df8275271fa85518e146c1db90760bfafaa6036b9f6afbe887fd7e9274c913786101668573a3e289b3411aa6842f
2 parents 2607c38 + af9a991 commit a7dc032

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)