mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 10:42:13 +02:00
Merge bitcoin/bitcoin#34831: lint: remove excluded files from whitespace check
f55c891a65lint: more reuse of SHARED_EXCLUDED_SUBTREES (fanquake)8864917d8blint: add missing ipc/test to grep_boost_fixture_test_suite (fanquake)ecefc12927lint: fix lint issue in lint script (fanquake)ee8c22eb6acontrib: fix whitespace issues in scripts (fanquake)04e2118372lint: remove excluded .cpp/.h files from whitespace check (fanquake) Pull request description: The `.cpp`/`.h` have been fixed since #32482 and5d25a82b9a. Fix other offending files. ACKs for top commit: stickies-v: re-ACKf55c891a65maflcko: re-ACKf55c891a65🗿 kevkevinpal: ACK [f55c891](f55c891a65) sedited: Re-ACKf55c891a65Tree-SHA512: 975c217d1cc82433b7960dad47976254d36526f3bd156133dcd4eb51b34616beb89e1449c245deb8b41ab6e1f746a96a0b629013e1996f355e521d075f4692c8
This commit is contained in:
@@ -34,9 +34,9 @@ tc filter add dev ${IF} parent 1: protocol ip prio 1 handle 1 fw classid 1:10
|
|||||||
tc filter add dev ${IF} parent 1: protocol ip prio 2 handle 2 fw classid 1:11
|
tc filter add dev ${IF} parent 1: protocol ip prio 2 handle 2 fw classid 1:11
|
||||||
|
|
||||||
if [ -n "${LOCALNET_V6}" ] ; then
|
if [ -n "${LOCALNET_V6}" ] ; then
|
||||||
# v6 cannot have the same priority value as v4
|
# v6 cannot have the same priority value as v4
|
||||||
tc filter add dev ${IF} parent 1: protocol ipv6 prio 3 handle 1 fw classid 1:10
|
tc filter add dev ${IF} parent 1: protocol ipv6 prio 3 handle 1 fw classid 1:10
|
||||||
tc filter add dev ${IF} parent 1: protocol ipv6 prio 4 handle 2 fw classid 1:11
|
tc filter add dev ${IF} parent 1: protocol ipv6 prio 4 handle 2 fw classid 1:11
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#delete any existing rules
|
#delete any existing rules
|
||||||
@@ -57,6 +57,6 @@ iptables -t mangle -A OUTPUT -p tcp -m tcp --dport 8333 ! -d ${LOCALNET_V4} -j M
|
|||||||
iptables -t mangle -A OUTPUT -p tcp -m tcp --sport 8333 ! -d ${LOCALNET_V4} -j MARK --set-mark 0x2
|
iptables -t mangle -A OUTPUT -p tcp -m tcp --sport 8333 ! -d ${LOCALNET_V4} -j MARK --set-mark 0x2
|
||||||
|
|
||||||
if [ -n "${LOCALNET_V6}" ] ; then
|
if [ -n "${LOCALNET_V6}" ] ; then
|
||||||
ip6tables -t mangle -A OUTPUT -p tcp -m tcp --dport 8333 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4
|
ip6tables -t mangle -A OUTPUT -p tcp -m tcp --dport 8333 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4
|
||||||
ip6tables -t mangle -A OUTPUT -p tcp -m tcp --sport 8333 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4
|
ip6tables -t mangle -A OUTPUT -p tcp -m tcp --sport 8333 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -9,27 +9,27 @@ if [ "$BITCOIN_VERIFY_COMMITS_ALLOW_SHA1" = 1 ]; then
|
|||||||
printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null
|
printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null
|
||||||
exit $?
|
exit $?
|
||||||
else
|
else
|
||||||
# Note how we've disabled SHA1 with the --weak-digest option, disabling
|
# Note how we've disabled SHA1 with the --weak-digest option, disabling
|
||||||
# signatures - including selfsigs - that use SHA1. While you might think that
|
# signatures - including selfsigs - that use SHA1. While you might think that
|
||||||
# collision attacks shouldn't be an issue as they'd be an attack on yourself,
|
# collision attacks shouldn't be an issue as they'd be an attack on yourself,
|
||||||
# in fact because what's being signed is a commit object that's
|
# in fact because what's being signed is a commit object that's
|
||||||
# semi-deterministically generated by untrusted input (the pull-req) in theory
|
# semi-deterministically generated by untrusted input (the pull-req) in theory
|
||||||
# an attacker could construct a pull-req that results in a commit object that
|
# an attacker could construct a pull-req that results in a commit object that
|
||||||
# they've created a collision for. Not the most likely attack, but preventing
|
# they've created a collision for. Not the most likely attack, but preventing
|
||||||
# it is pretty easy so we do so as a "belt-and-suspenders" measure.
|
# it is pretty easy so we do so as a "belt-and-suspenders" measure.
|
||||||
for LINE in $(gpg --version); do
|
for LINE in $(gpg --version); do
|
||||||
case "$LINE" in
|
case "$LINE" in
|
||||||
"gpg (GnuPG) 1.4.1"*|"gpg (GnuPG) 2.0."*)
|
"gpg (GnuPG) 1.4.1"*|"gpg (GnuPG) 2.0."*)
|
||||||
echo "Please upgrade to at least gpg 2.1.10 to check for weak signatures" > /dev/stderr
|
echo "Please upgrade to at least gpg 2.1.10 to check for weak signatures" > /dev/stderr
|
||||||
printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null
|
printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null
|
||||||
exit $?
|
exit $?
|
||||||
;;
|
;;
|
||||||
# We assume if you're running 2.1+, you're probably running 2.1.10+
|
# We assume if you're running 2.1+, you're probably running 2.1.10+
|
||||||
# gpg will fail otherwise
|
# gpg will fail otherwise
|
||||||
# We assume if you're running 1.X, it is either 1.4.1X or 1.4.20+
|
# We assume if you're running 1.X, it is either 1.4.1X or 1.4.20+
|
||||||
# gpg will fail otherwise
|
# gpg will fail otherwise
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
printf '%s\n' "$INPUT" | gpg --trust-model always --weak-digest sha1 "$@" 2>/dev/null
|
printf '%s\n' "$INPUT" | gpg --trust-model always --weak-digest sha1 "$@" 2>/dev/null
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -47,33 +47,33 @@ fi
|
|||||||
# Taken from git-subtree (Copyright (C) 2009 Avery Pennarun <apenwarr@gmail.com>)
|
# Taken from git-subtree (Copyright (C) 2009 Avery Pennarun <apenwarr@gmail.com>)
|
||||||
find_latest_squash()
|
find_latest_squash()
|
||||||
{
|
{
|
||||||
dir="$1"
|
dir="$1"
|
||||||
sq=
|
sq=
|
||||||
main=
|
main=
|
||||||
sub=
|
sub=
|
||||||
git log --grep="^git-subtree-dir: $dir/*\$" \
|
git log --grep="^git-subtree-dir: $dir/*\$" \
|
||||||
--pretty=format:'START %H%n%s%n%n%b%nEND%n' "$COMMIT" |
|
--pretty=format:'START %H%n%s%n%n%b%nEND%n' "$COMMIT" |
|
||||||
while read a b _; do
|
while read a b _; do
|
||||||
case "$a" in
|
case "$a" in
|
||||||
START) sq="$b" ;;
|
START) sq="$b" ;;
|
||||||
git-subtree-mainline:) main="$b" ;;
|
git-subtree-mainline:) main="$b" ;;
|
||||||
git-subtree-split:) sub="$b" ;;
|
git-subtree-split:) sub="$b" ;;
|
||||||
END)
|
END)
|
||||||
if [ -n "$sub" ]; then
|
if [ -n "$sub" ]; then
|
||||||
if [ -n "$main" ]; then
|
if [ -n "$main" ]; then
|
||||||
# a rejoin commit?
|
# a rejoin commit?
|
||||||
# Pretend its sub was a squash.
|
# Pretend its sub was a squash.
|
||||||
sq="$sub"
|
sq="$sub"
|
||||||
fi
|
fi
|
||||||
echo "$sq" "$sub"
|
echo "$sq" "$sub"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
sq=
|
sq=
|
||||||
main=
|
main=
|
||||||
sub=
|
sub=
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# find latest subtree update
|
# find latest subtree update
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ HEADER_ID_PREFIX = 'BITCOIN_'
|
|||||||
HEADER_ID_SUFFIX = '_H'
|
HEADER_ID_SUFFIX = '_H'
|
||||||
|
|
||||||
EXCLUDE_FILES_WITH_PREFIX = ['contrib/devtools/bitcoin-tidy',
|
EXCLUDE_FILES_WITH_PREFIX = ['contrib/devtools/bitcoin-tidy',
|
||||||
'src/crypto/ctaes',
|
|
||||||
'src/tinyformat.h',
|
'src/tinyformat.h',
|
||||||
'src/bench/nanobench.h',
|
'src/bench/nanobench.h',
|
||||||
'src/test/fuzz/FuzzedDataProvider.h'] + SHARED_EXCLUDED_SUBTREES
|
'src/test/fuzz/FuzzedDataProvider.h'] + SHARED_EXCLUDED_SUBTREES
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ import sys
|
|||||||
|
|
||||||
from subprocess import check_output, CalledProcessError
|
from subprocess import check_output, CalledProcessError
|
||||||
|
|
||||||
|
from lint_ignore_dirs import SHARED_EXCLUDED_SUBTREES
|
||||||
|
|
||||||
|
|
||||||
KNOWN_VIOLATIONS = [
|
KNOWN_VIOLATIONS = [
|
||||||
"src/dbwrapper.cpp:.*vsnprintf",
|
"src/dbwrapper.cpp:.*vsnprintf",
|
||||||
@@ -50,13 +52,8 @@ KNOWN_VIOLATIONS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
REGEXP_EXTERNAL_DEPENDENCIES_EXCLUSIONS = [
|
REGEXP_EXTERNAL_DEPENDENCIES_EXCLUSIONS = [
|
||||||
"src/crypto/ctaes/",
|
|
||||||
"src/ipc/libmultiprocess/",
|
|
||||||
"src/leveldb/",
|
|
||||||
"src/secp256k1/",
|
|
||||||
"src/minisketch/",
|
|
||||||
"src/tinyformat.h",
|
"src/tinyformat.h",
|
||||||
]
|
] + SHARED_EXCLUDED_SUBTREES
|
||||||
|
|
||||||
LOCALE_DEPENDENT_FUNCTIONS = [
|
LOCALE_DEPENDENT_FUNCTIONS = [
|
||||||
"alphasort", # LC_COLLATE (via strcoll)
|
"alphasort", # LC_COLLATE (via strcoll)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ def grep_boost_fixture_test_suite():
|
|||||||
"-E",
|
"-E",
|
||||||
r"^BOOST_FIXTURE_TEST_SUITE\(",
|
r"^BOOST_FIXTURE_TEST_SUITE\(",
|
||||||
"--",
|
"--",
|
||||||
|
"src/ipc/test/**.cpp",
|
||||||
"src/test/**.cpp",
|
"src/test/**.cpp",
|
||||||
"src/wallet/test/**.cpp",
|
"src/wallet/test/**.cpp",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -9,4 +9,5 @@ SHARED_EXCLUDED_SUBTREES = ["src/leveldb/",
|
|||||||
"src/secp256k1/",
|
"src/secp256k1/",
|
||||||
"src/minisketch/",
|
"src/minisketch/",
|
||||||
"src/ipc/libmultiprocess/",
|
"src/ipc/libmultiprocess/",
|
||||||
|
"src/crypto/ctaes/",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -18,17 +18,9 @@ fn get_pathspecs_exclude_whitespace() -> Vec<String> {
|
|||||||
"contrib/windeploy/win-codesign.cert",
|
"contrib/windeploy/win-codesign.cert",
|
||||||
"doc/README_windows.txt",
|
"doc/README_windows.txt",
|
||||||
// Temporary excludes, or existing violations
|
// Temporary excludes, or existing violations
|
||||||
"contrib/init/bitcoind.openrc",
|
|
||||||
"contrib/macdeploy/macdeployqtplus",
|
|
||||||
"src/crypto/sha256_sse4.cpp",
|
|
||||||
"src/qt/res/src/*.svg",
|
"src/qt/res/src/*.svg",
|
||||||
"test/functional/test_framework/crypto/ellswift_decode_test_vectors.csv",
|
"test/functional/test_framework/crypto/ellswift_decode_test_vectors.csv",
|
||||||
"test/functional/test_framework/crypto/xswiftec_inv_test_vectors.csv",
|
"test/functional/test_framework/crypto/xswiftec_inv_test_vectors.csv",
|
||||||
"contrib/qos/tc.sh",
|
|
||||||
"contrib/verify-commits/gpg.sh",
|
|
||||||
"src/univalue/include/univalue_escapes.h",
|
|
||||||
"src/univalue/test/object.cpp",
|
|
||||||
"test/lint/git-subtree-check.sh",
|
|
||||||
]
|
]
|
||||||
.iter()
|
.iter()
|
||||||
.map(|s| format!(":(exclude){s}")),
|
.map(|s| format!(":(exclude){s}")),
|
||||||
|
|||||||
Reference in New Issue
Block a user