mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
Merge #14785: Scripts: Fix detection of copyright holders
af9a9918b2
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
This commit is contained in:
commit
a7dc03223e
1 changed files with 15 additions and 15 deletions
|
@ -15,35 +15,32 @@ import os
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
EXCLUDE = [
|
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:
|
# auto generated:
|
||||||
'src/qt/bitcoinstrings.cpp',
|
'src/qt/bitcoinstrings.cpp',
|
||||||
'src/chainparamsseeds.h',
|
'src/chainparamsseeds.h',
|
||||||
# other external copyrights:
|
# other external copyrights:
|
||||||
'src/tinyformat.h',
|
'src/tinyformat.h',
|
||||||
'src/leveldb/util/env_win.cc',
|
|
||||||
'src/crypto/ctaes/bench.c',
|
|
||||||
'test/functional/test_framework/bignum.py',
|
'test/functional/test_framework/bignum.py',
|
||||||
# python init:
|
# python init:
|
||||||
'*__init__.py',
|
'*__init__.py',
|
||||||
]
|
]
|
||||||
EXCLUDE_COMPILED = re.compile('|'.join([fnmatch.translate(m) for m in EXCLUDE]))
|
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 = ['*.h', '*.cpp', '*.cc', '*.c', '*.py']
|
||||||
INCLUDE_COMPILED = re.compile('|'.join([fnmatch.translate(m) for m in INCLUDE]))
|
INCLUDE_COMPILED = re.compile('|'.join([fnmatch.translate(m) for m in INCLUDE]))
|
||||||
|
|
||||||
def applies_to_file(filename):
|
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
|
return ((EXCLUDE_COMPILED.match(filename) is None) and
|
||||||
(INCLUDE_COMPILED.match(filename) is not None))
|
(INCLUDE_COMPILED.match(filename) is not None))
|
||||||
|
|
||||||
|
@ -81,7 +78,7 @@ ANY_COPYRIGHT_STYLE_OR_YEAR_STYLE = ("%s %s" % (ANY_COPYRIGHT_STYLE,
|
||||||
ANY_COPYRIGHT_COMPILED = re.compile(ANY_COPYRIGHT_STYLE_OR_YEAR_STYLE)
|
ANY_COPYRIGHT_COMPILED = re.compile(ANY_COPYRIGHT_STYLE_OR_YEAR_STYLE)
|
||||||
|
|
||||||
def compile_copyright_regex(copyright_style, year_style, name):
|
def compile_copyright_regex(copyright_style, year_style, name):
|
||||||
return re.compile('%s %s %s' % (copyright_style, year_style, name))
|
return re.compile('%s %s,? %s' % (copyright_style, year_style, name))
|
||||||
|
|
||||||
EXPECTED_HOLDER_NAMES = [
|
EXPECTED_HOLDER_NAMES = [
|
||||||
"Satoshi Nakamoto\n",
|
"Satoshi Nakamoto\n",
|
||||||
|
@ -107,6 +104,9 @@ EXPECTED_HOLDER_NAMES = [
|
||||||
"Jan-Klaas Kollhof\n",
|
"Jan-Klaas Kollhof\n",
|
||||||
"Sam Rushing\n",
|
"Sam Rushing\n",
|
||||||
"ArtForz -- public domain half-a-node\n",
|
"ArtForz -- public domain half-a-node\n",
|
||||||
|
"Intel Corporation",
|
||||||
|
"The Zcash developers",
|
||||||
|
"Jeremy Rubin",
|
||||||
]
|
]
|
||||||
|
|
||||||
DOMINANT_STYLE_COMPILED = {}
|
DOMINANT_STYLE_COMPILED = {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue