Changeset View
Changeset View
Standalone View
Standalone View
contrib/devtools/copyright_header.py
Show All 31 Lines | |||||
EXCLUDE_DIRS = [ | EXCLUDE_DIRS = [ | ||||
# git subtrees | # git subtrees | ||||
"src/crypto/ctaes/", | "src/crypto/ctaes/", | ||||
"src/leveldb/", | "src/leveldb/", | ||||
"src/secp256k1/", | "src/secp256k1/", | ||||
"src/univalue/", | "src/univalue/", | ||||
] | ] | ||||
INCLUDE = ['*.h', '*.cpp', '*.cc', '*.c', '*.py'] | INCLUDE = ['*.h', '*.cpp', '*.cc', '*.c', '*.mm', '*.py'] | ||||
INCLUDE_COMPILED = re.compile( | INCLUDE_COMPILED = re.compile( | ||||
'|'.join([fnmatch.translate(m) for m in INCLUDE])) | '|'.join([fnmatch.translate(m) for m in INCLUDE])) | ||||
def applies_to_file(filename): | def applies_to_file(filename): | ||||
for excluded_dir in EXCLUDE_DIRS: | for excluded_dir in EXCLUDE_DIRS: | ||||
if filename.startswith(excluded_dir): | if filename.startswith(excluded_dir): | ||||
return False | return False | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
def compile_copyright_regex(copyright_style, year_style, name): | 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 = [ | EXPECTED_HOLDER_NAMES = [ | ||||
r"Satoshi Nakamoto\n", | r"Satoshi Nakamoto\n", | ||||
r"The Bitcoin Core developers\n", | r"The Bitcoin Core developers\n", | ||||
r"Bitcoin Core Developers\n", | |||||
r"The Bitcoin developers\n", | r"The Bitcoin developers\n", | ||||
r"BitPay Inc\.\n", | r"BitPay Inc\.\n", | ||||
r"University of Illinois at Urbana-Champaign\.\n", | r"University of Illinois at Urbana-Champaign\.\n", | ||||
r"Pieter Wuille\n", | r"Pieter Wuille\n", | ||||
r"Wladimir J. van der Laan\n", | r"Wladimir J. van der Laan\n", | ||||
r"Jeff Garzik\n", | r"Jeff Garzik\n", | ||||
r"Jan-Klaas Kollhof\n", | r"Jan-Klaas Kollhof\n", | ||||
r"Sam Rushing\n", | |||||
r"ArtForz -- public domain half-a-node\n", | r"ArtForz -- public domain half-a-node\n", | ||||
r"Amaury SÉCHET\n", | r"Amaury SÉCHET\n", | ||||
r"Intel Corporation\n", | r"Intel Corporation\n", | ||||
r"The Zcash developers\n", | r"The Zcash developers\n", | ||||
r"Jeremy Rubin\n", | r"Jeremy Rubin\n", | ||||
] | ] | ||||
DOMINANT_STYLE_COMPILED = {} | DOMINANT_STYLE_COMPILED = {} | ||||
▲ Show 20 Lines • Show All 559 Lines • Show Last 20 Lines |