Changeset View
Changeset View
Standalone View
Standalone View
contrib/devtools/copyright_header.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2016 The Bitcoin Core developers | # Copyright (c) 2016 The Bitcoin Core developers | ||||
# Copyright (c) 2017 The Bitcoin developers | # Copyright (c) 2017-2019 The Bitcoin developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
import re | import re | ||||
import fnmatch | import fnmatch | ||||
import sys | import sys | ||||
import subprocess | import subprocess | ||||
import datetime | import datetime | ||||
Show All 20 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', '*.mm', '*.py'] | INCLUDE = ['*.h', '*.cpp', '*.cc', '*.c', '*.mm', '*.py', '*.sh', | ||||
'*.bash-completion'] | |||||
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 629 Lines • Show Last 20 Lines |