-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: merge bitcoin#22903, #24753, #24831, #28240, #27012, #25713, #24971, #25047 (clang-tidy and IWYU) #6559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a6e80ec
c673048
8e8faa2
2980992
5647652
104ba87
71b400d
85d96c2
4009777
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,10 @@ export CONTAINER_NAME=ci_native_multiprocess | |
| export HOST=x86_64-pc-linux-gnu | ||
| export PACKAGES="cmake python3 llvm clang" | ||
| export DEP_OPTS="MULTIPROCESS=1 CC=clang-18 CXX=clang++-18" | ||
| export RUN_TIDY=true | ||
| export GOAL="install" | ||
| export TEST_RUNNER_EXTRA="--v2transport" | ||
| export BITCOIN_CONFIG="--with-boost-process --enable-debug CC=clang-18 CXX=clang++-18" # Use clang to avoid OOM | ||
| # Additional flags for RUN_TIDY | ||
| export BITCOIN_CONFIG="${BITCOIN_CONFIG} --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0'" | ||
|
||
| export BITCOIND=dash-node # Used in functional tests | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Fixups / upstreamed changes | ||
| [ | ||
| { include: [ "<bits/termios-c_lflag.h>", private, "<termios.h>", public ] }, | ||
| { include: [ "<bits/termios-struct.h>", private, "<termios.h>", public ] }, | ||
| { include: [ "<bits/termios-tcflow.h>", private, "<termios.h>", public ] }, | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "output": { | ||
| "content": { | ||
| "include_only_existing_source": true, | ||
| "paths_to_include": [], | ||
| "paths_to_exclude": [ | ||
| "src/crc32", | ||
| "src/crypto/x11", | ||
| "src/dashbls", | ||
| "src/gsl", | ||
| "src/immer", | ||
| "src/leveldb", | ||
| "src/minisketch", | ||
| "src/univalue", | ||
| "src/secp256k1" | ||
| ] | ||
| }, | ||
| "format": { | ||
| "command_as_array": true, | ||
| "drop_output_field": false | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| Checks: ' | ||
| -*, | ||
| bugprone-argument-comment, | ||
| modernize-use-nullptr, | ||
| readability-redundant-declaration, | ||
| ' | ||
| WarningsAsErrors: ' | ||
| bugprone-argument-comment, | ||
| modernize-use-nullptr, | ||
| readability-redundant-declaration, | ||
| ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Enhance robustness of code quality checks.
Several improvements could make the code quality checks more robust:
if [ "${RUN_TIDY}" = "true" ]; then set -eo pipefail cd src - ( run-clang-tidy -quiet "${MAKEJOBS}" ) | grep -C5 "error" + TIDY_OUTPUT="$(mktemp -t dash_tidy.XXXXXX)" + ( run-clang-tidy -quiet "${MAKEJOBS}" ) | tee "${TIDY_OUTPUT}" + if grep -q "error:" "${TIDY_OUTPUT}"; then + echo "Found clang-tidy errors:" + grep -C5 "error:" "${TIDY_OUTPUT}" + rm "${TIDY_OUTPUT}" + exit 1 + fi + rm "${TIDY_OUTPUT}" cd .. + IWYU_OUTPUT="$(mktemp -t dash_iwyu.XXXXXX)" iwyu_tool.py \ "src/compat" \ "src/init" \ "src/rpc/fees.cpp" \ "src/rpc/signmessage.cpp" \ -p . "${MAKEJOBS}" \ -- -Xiwyu --cxx17ns -Xiwyu --mapping_file="${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp" \ - |& tee "/tmp/iwyu_ci.out" + |& tee "${IWYU_OUTPUT}" cd src - fix_includes.py --nosafe_headers < /tmp/iwyu_ci.out + fix_includes.py --nosafe_headers < "${IWYU_OUTPUT}" git --no-pager diff + rm "${IWYU_OUTPUT}" + # Optionally commit IWYU changes: + # if ! git diff --quiet; then + # git add -u + # git commit -m "style: apply IWYU fixes" + # fi fi📝 Committable suggestion