mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-31 02:31:07 +00:00
iwyu: Add patch to prefer angled brackets over quotes for includes
This commit is contained in:
parent
fe0e31f1ef
commit
7a65437e23
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
# Only ignore unexpected patches
|
# Only ignore unexpected patches
|
||||||
*.patch
|
*.patch
|
||||||
|
!ci/test/*.patch
|
||||||
!contrib/guix/patches/*.patch
|
!contrib/guix/patches/*.patch
|
||||||
!depends/patches/**/*.patch
|
!depends/patches/**/*.patch
|
||||||
|
|
||||||
|
|||||||
@ -81,6 +81,7 @@ fi
|
|||||||
|
|
||||||
if [[ "${RUN_TIDY}" == "true" ]]; then
|
if [[ "${RUN_TIDY}" == "true" ]]; then
|
||||||
${CI_RETRY_EXE} git clone --depth=1 https://github.com/include-what-you-use/include-what-you-use -b clang_"${TIDY_LLVM_V}" /include-what-you-use
|
${CI_RETRY_EXE} git clone --depth=1 https://github.com/include-what-you-use/include-what-you-use -b clang_"${TIDY_LLVM_V}" /include-what-you-use
|
||||||
|
(cd /include-what-you-use && patch -p1 < /ci_container_base/ci/test/01_iwyu.patch)
|
||||||
cmake -B /iwyu-build/ -G 'Unix Makefiles' -DCMAKE_PREFIX_PATH=/usr/lib/llvm-"${TIDY_LLVM_V}" -S /include-what-you-use
|
cmake -B /iwyu-build/ -G 'Unix Makefiles' -DCMAKE_PREFIX_PATH=/usr/lib/llvm-"${TIDY_LLVM_V}" -S /include-what-you-use
|
||||||
make -C /iwyu-build/ install "$MAKEJOBS"
|
make -C /iwyu-build/ install "$MAKEJOBS"
|
||||||
fi
|
fi
|
||||||
|
|||||||
14
ci/test/01_iwyu.patch
Normal file
14
ci/test/01_iwyu.patch
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
Prefer angled brackets over quotes for include directives.
|
||||||
|
See: https://en.cppreference.com/w/cpp/preprocessor/include.html.
|
||||||
|
|
||||||
|
--- a/iwyu_path_util.cc
|
||||||
|
+++ b/iwyu_path_util.cc
|
||||||
|
@@ -211,7 +211,7 @@ bool IsQuotedInclude(const string& s) {
|
||||||
|
}
|
||||||
|
|
||||||
|
string AddQuotes(string include_name, bool angled) {
|
||||||
|
- if (angled) {
|
||||||
|
+ if (true) {
|
||||||
|
return "<" + include_name + ">";
|
||||||
|
}
|
||||||
|
return "\"" + include_name + "\"";
|
||||||
@ -15,7 +15,7 @@ ARG BASE_ROOT_DIR
|
|||||||
ENV BASE_ROOT_DIR=${BASE_ROOT_DIR}
|
ENV BASE_ROOT_DIR=${BASE_ROOT_DIR}
|
||||||
|
|
||||||
COPY ./ci/retry/retry /usr/bin/retry
|
COPY ./ci/retry/retry /usr/bin/retry
|
||||||
COPY ./ci/test/00_setup_env.sh ./${FILE_ENV} ./ci/test/01_base_install.sh /ci_container_base/ci/test/
|
COPY ./ci/test/00_setup_env.sh ./${FILE_ENV} ./ci/test/01_base_install.sh ./ci/test/01_iwyu.patch /ci_container_base/ci/test/
|
||||||
|
|
||||||
# Bash is required, so install it when missing
|
# Bash is required, so install it when missing
|
||||||
RUN sh -c "bash -c 'true' || ( apk update && apk add --no-cache bash )"
|
RUN sh -c "bash -c 'true' || ( apk update && apk add --no-cache bash )"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user