mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
iwyu: Add patch to prefer angled brackets over quotes for includes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,6 +12,7 @@
|
||||
|
||||
# Only ignore unexpected patches
|
||||
*.patch
|
||||
!ci/test/*.patch
|
||||
!contrib/guix/patches/*.patch
|
||||
!depends/patches/**/*.patch
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ fi
|
||||
|
||||
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
|
||||
(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
|
||||
make -C /iwyu-build/ install "$MAKEJOBS"
|
||||
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}
|
||||
|
||||
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
|
||||
RUN sh -c "bash -c 'true' || ( apk update && apk add --no-cache bash )"
|
||||
|
||||
Reference in New Issue
Block a user