diff --git a/contrib/devtools/copyright_header.py b/contrib/devtools/copyright_header.py --- a/contrib/devtools/copyright_header.py +++ b/contrib/devtools/copyright_header.py @@ -16,25 +16,11 @@ ########################################################################## EXCLUDE = [ - # libsecp256k1: - 'src/secp256k1/include/secp256k1.h', - 'src/secp256k1/include/secp256k1_ecdh.h', - 'src/secp256k1/include/secp256k1_recovery.h', - 'src/secp256k1/include/secp256k1_schnorr.h', - 'src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c', - 'src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h', - 'src/secp256k1/src/java/org_bitcoin_Secp256k1Context.c', - 'src/secp256k1/src/java/org_bitcoin_Secp256k1Context.h', - # univalue: - 'src/univalue/test/object.cpp', - 'src/univalue/lib/univalue_escapes.h', # auto generated: 'src/qt/bitcoinstrings.cpp', 'src/chainparamsseeds.h', # other external copyrights: 'src/tinyformat.h', - 'src/leveldb/util/env_win.cc', - 'src/crypto/ctaes/bench.c', 'test/functional/test_framework/bignum.py', # python init: '*__init__.py', @@ -42,12 +28,23 @@ EXCLUDE_COMPILED = re.compile( '|'.join([fnmatch.translate(m) for m in EXCLUDE])) +EXCLUDE_DIRS = [ + # git subtrees + "src/crypto/ctaes/", + "src/leveldb/", + "src/secp256k1/", + "src/univalue/", +] + INCLUDE = ['*.h', '*.cpp', '*.cc', '*.c', '*.py'] INCLUDE_COMPILED = re.compile( '|'.join([fnmatch.translate(m) for m in INCLUDE])) def applies_to_file(filename): + for excluded_dir in EXCLUDE_DIRS: + if filename.startswith(excluded_dir): + return False return ((EXCLUDE_COMPILED.match(filename) is None) and (INCLUDE_COMPILED.match(filename) is not None)) @@ -89,7 +86,7 @@ def compile_copyright_regex(copyright_style, year_style, name): - return re.compile('{} {} {}'.format(copyright_style, year_style, name)) + return re.compile('{} {},? {}'.format(copyright_style, year_style, name)) EXPECTED_HOLDER_NAMES = [ @@ -117,6 +114,8 @@ r"Sam Rushing\n", r"ArtForz -- public domain half-a-node\n", r"Amaury SÉCHET\n", + r"Intel Corporation\n", + r"The Zcash developers\n", r"Jeremy Rubin\n", ]