From 38b98f236153dbf9c5742a519fd50ca47a288e9f Mon Sep 17 00:00:00 2001 From: LinZhihao-723 Date: Mon, 2 Dec 2024 11:56:54 -0500 Subject: [PATCH] Add wrappers for dependencies headers --- CMakeLists.txt | 10 +++++++++- lint-tasks.yml | 6 +++++- src/clp_ffi_py/.clang-format | 8 ++++++-- src/clp_ffi_py/PyExceptionContext.hpp | 2 +- src/clp_ffi_py/PyObjectCast.hpp | 2 +- src/clp_ffi_py/PyObjectUtils.hpp | 2 +- src/clp_ffi_py/Py_utils.cpp | 2 +- src/clp_ffi_py/Py_utils.hpp | 2 +- .../ir/native/DeserializerBufferReader.cpp | 2 +- .../ir/native/DeserializerBufferReader.hpp | 2 +- src/clp_ffi_py/ir/native/PyDeserializer.cpp | 2 +- src/clp_ffi_py/ir/native/PyDeserializer.hpp | 2 +- src/clp_ffi_py/ir/native/PyDeserializerBuffer.cpp | 2 +- src/clp_ffi_py/ir/native/PyDeserializerBuffer.hpp | 2 +- src/clp_ffi_py/ir/native/PyFourByteDeserializer.cpp | 2 +- src/clp_ffi_py/ir/native/PyFourByteDeserializer.hpp | 2 +- src/clp_ffi_py/ir/native/PyFourByteSerializer.cpp | 2 +- src/clp_ffi_py/ir/native/PyFourByteSerializer.hpp | 2 +- src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.cpp | 2 +- src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.hpp | 2 +- src/clp_ffi_py/ir/native/PyLogEvent.cpp | 2 +- src/clp_ffi_py/ir/native/PyLogEvent.hpp | 2 +- src/clp_ffi_py/ir/native/PyMetadata.cpp | 2 +- src/clp_ffi_py/ir/native/PyMetadata.hpp | 2 +- src/clp_ffi_py/ir/native/PyQuery.cpp | 2 +- src/clp_ffi_py/ir/native/PyQuery.hpp | 2 +- src/clp_ffi_py/ir/native/PySerializer.cpp | 2 +- src/clp_ffi_py/ir/native/PySerializer.hpp | 2 +- .../ir/native/deserialization_methods.cpp | 2 +- .../ir/native/deserialization_methods.hpp | 2 +- src/clp_ffi_py/ir/native/serialization_methods.cpp | 2 +- src/clp_ffi_py/ir/native/serialization_methods.hpp | 2 +- src/clp_ffi_py/modules/ir_native.cpp | 2 +- src/clp_ffi_py/utils.cpp | 4 ++-- src/clp_ffi_py/utils.hpp | 4 ++-- .../Python.hpp | 2 ++ src/wrapped_dependency_headers/msgpack.hpp | 13 +++++++++++++ 37 files changed, 69 insertions(+), 38 deletions(-) rename src/{clp_ffi_py => wrapped_dependency_headers}/Python.hpp (94%) create mode 100644 src/wrapped_dependency_headers/msgpack.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 426b3e65..33729488 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ target_compile_features(${CLP_FFI_PY_LIB_IR} PRIVATE cxx_std_20) set(CLP_FFI_PY_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src") set(CLP_FFI_PY_LIB_SRC_DIR "${CLP_FFI_PY_SRC_DIR}/clp_ffi_py") +set(CLP_FFI_PY_WRAPPED_DEPENDENCY_HEADERS_DIR "${CLP_FFI_PY_SRC_DIR}/wrapped_dependency_headers") set(CLP_FFI_PY_CLP_CORE_DIR "${CLP_FFI_PY_SRC_DIR}/clp/components/core") # Add CLP's string_utils @@ -127,16 +128,23 @@ set(CLP_FFI_PY_LIB_IR_SOURCES ${CLP_FFI_PY_LIB_SRC_DIR}/PyExceptionContext.hpp ${CLP_FFI_PY_LIB_SRC_DIR}/PyObjectCast.hpp ${CLP_FFI_PY_LIB_SRC_DIR}/PyObjectUtils.hpp - ${CLP_FFI_PY_LIB_SRC_DIR}/Python.hpp ${CLP_FFI_PY_LIB_SRC_DIR}/utils.cpp ${CLP_FFI_PY_LIB_SRC_DIR}/utils.hpp ) +# NOTE: these headers are wrappers of third-party dependency libraries. They are required to silent +# clang-tidy warnings for missing direct includes. +set(CLP_FFI_PY_WRAPPED_DEPENDENCY_HEADERS_SOURCES + ${CLP_FFI_PY_WRAPPED_DEPENDENCY_HEADERS_DIR}/msgpack.hpp + ${CLP_FFI_PY_WRAPPED_DEPENDENCY_HEADERS_DIR}/Python.hpp +) + target_sources( ${CLP_FFI_PY_LIB_IR} PRIVATE ${CLP_FFI_PY_CLP_CORE_SOURCES} ${CLP_FFI_PY_LIB_IR_SOURCES} + ${CLP_FFI_PY_WRAPPED_DEPENDENCY_HEADERS_SOURCES} ) # NOTE: We mark the include directories below as system headers so that the compiler (including diff --git a/lint-tasks.yml b/lint-tasks.yml index c194545e..2ba46b89 100644 --- a/lint-tasks.yml +++ b/lint-tasks.yml @@ -4,7 +4,10 @@ vars: G_LINT_VENV_DIR: "{{.BUILD_DIR}}/lint-venv" G_LINT_VENV_CHECKSUM_FILE: "{{.BUILD_DIR}}/lint#venv.md5" # Linter target dirs - G_CPP_LINT_DIRS: ["{{.CLP_FFI_PY_CPP_SRC_DIR}}"] + G_CPP_WRAPPED_DEPENDENCY_HEADERS_DIR: "{{.ROOT_DIR}}/src/wrapped_dependency_headers" + G_CPP_LINT_DIRS: + - "{{.CLP_FFI_PY_CPP_SRC_DIR}}" + - "{{.G_CPP_WRAPPED_DEPENDENCY_HEADERS_DIR}}" G_PYTHON_LINT_DIRS: ["{{.ROOT_DIR}}/clp_ffi_py", "{{.ROOT_DIR}}/tests"] tasks: @@ -108,6 +111,7 @@ tasks: # and so that the workflow doesn't fail due to violations in other files. - "{{.CLP_FFI_PY_CPP_SRC_DIR}}/Py_utils.cpp" - "{{.CLP_FFI_PY_CPP_SRC_DIR}}/Py_utils.hpp" + - "{{.G_CPP_WRAPPED_DEPENDENCY_HEADERS_DIR}}" VENV_DIR: "{{.G_LINT_VENV_DIR}}" py-check: diff --git a/src/clp_ffi_py/.clang-format b/src/clp_ffi_py/.clang-format index 20b6c95c..19185adc 100644 --- a/src/clp_ffi_py/.clang-format +++ b/src/clp_ffi_py/.clang-format @@ -4,13 +4,17 @@ IndentExternBlock: "NoIndent" IncludeCategories: # NOTE: A header is grouped by first matching regex # Python header must be included before any others - - Regex: "^$" + - Regex: "^$" Priority: -1 # Project headers - Regex: "^$" diff --git a/src/clp_ffi_py/PyExceptionContext.hpp b/src/clp_ffi_py/PyExceptionContext.hpp index c5efeb95..9a2f651c 100644 --- a/src/clp_ffi_py/PyExceptionContext.hpp +++ b/src/clp_ffi_py/PyExceptionContext.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_PYEXCEPTIONCONTEXT_HPP #define CLP_FFI_PY_PYEXCEPTIONCONTEXT_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files namespace clp_ffi_py { /** diff --git a/src/clp_ffi_py/PyObjectCast.hpp b/src/clp_ffi_py/PyObjectCast.hpp index a7338fea..dea477ee 100644 --- a/src/clp_ffi_py/PyObjectCast.hpp +++ b/src/clp_ffi_py/PyObjectCast.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_PY_OBJECT_CAST_HPP #define CLP_FFI_PY_PY_OBJECT_CAST_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include diff --git a/src/clp_ffi_py/PyObjectUtils.hpp b/src/clp_ffi_py/PyObjectUtils.hpp index c8168792..9c890363 100644 --- a/src/clp_ffi_py/PyObjectUtils.hpp +++ b/src/clp_ffi_py/PyObjectUtils.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_PY_OBJECT_UTILS_HPP #define CLP_FFI_PY_PY_OBJECT_UTILS_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include diff --git a/src/clp_ffi_py/Py_utils.cpp b/src/clp_ffi_py/Py_utils.cpp index 9e13e36b..64c3c1ff 100644 --- a/src/clp_ffi_py/Py_utils.cpp +++ b/src/clp_ffi_py/Py_utils.cpp @@ -1,4 +1,4 @@ -#include // Must always be included before any other header file +#include // Must be included before any other header file #include "Py_utils.hpp" diff --git a/src/clp_ffi_py/Py_utils.hpp b/src/clp_ffi_py/Py_utils.hpp index 4a3f1586..76d584f1 100644 --- a/src/clp_ffi_py/Py_utils.hpp +++ b/src/clp_ffi_py/Py_utils.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_PY_UTILS_HPP #define CLP_FFI_PY_PY_UTILS_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include #include diff --git a/src/clp_ffi_py/ir/native/DeserializerBufferReader.cpp b/src/clp_ffi_py/ir/native/DeserializerBufferReader.cpp index 9e29bc4a..07800549 100644 --- a/src/clp_ffi_py/ir/native/DeserializerBufferReader.cpp +++ b/src/clp_ffi_py/ir/native/DeserializerBufferReader.cpp @@ -1,4 +1,4 @@ -#include // Must always be included before any other header files +#include // Must be included before any other header files #include "DeserializerBufferReader.hpp" diff --git a/src/clp_ffi_py/ir/native/DeserializerBufferReader.hpp b/src/clp_ffi_py/ir/native/DeserializerBufferReader.hpp index e20def43..472fa3c7 100644 --- a/src/clp_ffi_py/ir/native/DeserializerBufferReader.hpp +++ b/src/clp_ffi_py/ir/native/DeserializerBufferReader.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_IR_NATIVE_DESERIALIZERBUFFERREADER_HPP #define CLP_FFI_PY_IR_NATIVE_DESERIALIZERBUFFERREADER_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include diff --git a/src/clp_ffi_py/ir/native/PyDeserializer.cpp b/src/clp_ffi_py/ir/native/PyDeserializer.cpp index b00166a2..8053ef21 100644 --- a/src/clp_ffi_py/ir/native/PyDeserializer.cpp +++ b/src/clp_ffi_py/ir/native/PyDeserializer.cpp @@ -1,4 +1,4 @@ -#include // Must always be included before any other header files +#include // Must be included before any other header files #include "PyDeserializer.hpp" diff --git a/src/clp_ffi_py/ir/native/PyDeserializer.hpp b/src/clp_ffi_py/ir/native/PyDeserializer.hpp index 72fb438c..e8b243ca 100644 --- a/src/clp_ffi_py/ir/native/PyDeserializer.hpp +++ b/src/clp_ffi_py/ir/native/PyDeserializer.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_IR_NATIVE_PYDESERIALIZER_HPP #define CLP_FFI_PY_IR_NATIVE_PYDESERIALIZER_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include #include diff --git a/src/clp_ffi_py/ir/native/PyDeserializerBuffer.cpp b/src/clp_ffi_py/ir/native/PyDeserializerBuffer.cpp index 1fa99905..cbea043f 100644 --- a/src/clp_ffi_py/ir/native/PyDeserializerBuffer.cpp +++ b/src/clp_ffi_py/ir/native/PyDeserializerBuffer.cpp @@ -1,4 +1,4 @@ -#include // Must always be included before any other header files +#include // Must be included before any other header files #include "PyDeserializerBuffer.hpp" diff --git a/src/clp_ffi_py/ir/native/PyDeserializerBuffer.hpp b/src/clp_ffi_py/ir/native/PyDeserializerBuffer.hpp index d0da8bab..032f548d 100644 --- a/src/clp_ffi_py/ir/native/PyDeserializerBuffer.hpp +++ b/src/clp_ffi_py/ir/native/PyDeserializerBuffer.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_IR_NATIVE_PYDESERIALIZERBUFFER_HPP #define CLP_FFI_PY_IR_NATIVE_PYDESERIALIZERBUFFER_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include diff --git a/src/clp_ffi_py/ir/native/PyFourByteDeserializer.cpp b/src/clp_ffi_py/ir/native/PyFourByteDeserializer.cpp index 5883ef96..eb7e8a31 100644 --- a/src/clp_ffi_py/ir/native/PyFourByteDeserializer.cpp +++ b/src/clp_ffi_py/ir/native/PyFourByteDeserializer.cpp @@ -1,4 +1,4 @@ -#include // Must always be included before any other header files +#include // Must be included before any other header files #include "PyFourByteDeserializer.hpp" diff --git a/src/clp_ffi_py/ir/native/PyFourByteDeserializer.hpp b/src/clp_ffi_py/ir/native/PyFourByteDeserializer.hpp index 663f71a1..5d409e1e 100644 --- a/src/clp_ffi_py/ir/native/PyFourByteDeserializer.hpp +++ b/src/clp_ffi_py/ir/native/PyFourByteDeserializer.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_IR_NATIVE_PYFOURBYTEDESERIALIZER_HPP #define CLP_FFI_PY_IR_NATIVE_PYFOURBYTEDESERIALIZER_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include diff --git a/src/clp_ffi_py/ir/native/PyFourByteSerializer.cpp b/src/clp_ffi_py/ir/native/PyFourByteSerializer.cpp index b183cb82..9c2a52c3 100644 --- a/src/clp_ffi_py/ir/native/PyFourByteSerializer.cpp +++ b/src/clp_ffi_py/ir/native/PyFourByteSerializer.cpp @@ -1,4 +1,4 @@ -#include // Must always be included before any other header files +#include // Must be included before any other header files #include "PyFourByteSerializer.hpp" diff --git a/src/clp_ffi_py/ir/native/PyFourByteSerializer.hpp b/src/clp_ffi_py/ir/native/PyFourByteSerializer.hpp index 56a179f9..2044d24e 100644 --- a/src/clp_ffi_py/ir/native/PyFourByteSerializer.hpp +++ b/src/clp_ffi_py/ir/native/PyFourByteSerializer.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_IR_NATIVE_PYFOURBYTESERIALIZER_HPP #define CLP_FFI_PY_IR_NATIVE_PYFOURBYTESERIALIZER_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include diff --git a/src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.cpp b/src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.cpp index 518e586e..ddd72ea8 100644 --- a/src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.cpp +++ b/src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.cpp @@ -1,4 +1,4 @@ -#include // Must always be included before any other header files +#include // Must be included before any other header files #include "PyKeyValuePairLogEvent.hpp" diff --git a/src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.hpp b/src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.hpp index f41d2972..215e3638 100644 --- a/src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.hpp +++ b/src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_IR_NATIVE_PYKEYVALUEPAIRLOGEVENT_HPP #define CLP_FFI_PY_IR_NATIVE_PYKEYVALUEPAIRLOGEVENT_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include #include diff --git a/src/clp_ffi_py/ir/native/PyLogEvent.cpp b/src/clp_ffi_py/ir/native/PyLogEvent.cpp index 59a575e5..f53b498c 100644 --- a/src/clp_ffi_py/ir/native/PyLogEvent.cpp +++ b/src/clp_ffi_py/ir/native/PyLogEvent.cpp @@ -1,4 +1,4 @@ -#include // Must always be included before any other header files +#include // Must be included before any other header files #include "PyLogEvent.hpp" diff --git a/src/clp_ffi_py/ir/native/PyLogEvent.hpp b/src/clp_ffi_py/ir/native/PyLogEvent.hpp index aa18c524..9bfb2c7b 100644 --- a/src/clp_ffi_py/ir/native/PyLogEvent.hpp +++ b/src/clp_ffi_py/ir/native/PyLogEvent.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_IR_NATIVE_PYLOGEVENT_HPP #define CLP_FFI_PY_IR_NATIVE_PYLOGEVENT_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include diff --git a/src/clp_ffi_py/ir/native/PyMetadata.cpp b/src/clp_ffi_py/ir/native/PyMetadata.cpp index f69e1834..4ef1e1af 100644 --- a/src/clp_ffi_py/ir/native/PyMetadata.cpp +++ b/src/clp_ffi_py/ir/native/PyMetadata.cpp @@ -1,4 +1,4 @@ -#include +#include #include "PyMetadata.hpp" diff --git a/src/clp_ffi_py/ir/native/PyMetadata.hpp b/src/clp_ffi_py/ir/native/PyMetadata.hpp index 482f4216..a759a1b6 100644 --- a/src/clp_ffi_py/ir/native/PyMetadata.hpp +++ b/src/clp_ffi_py/ir/native/PyMetadata.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_IR_NATIVE_PYMETADATA_HPP #define CLP_FFI_PY_IR_NATIVE_PYMETADATA_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include diff --git a/src/clp_ffi_py/ir/native/PyQuery.cpp b/src/clp_ffi_py/ir/native/PyQuery.cpp index 76e400ac..6463a044 100644 --- a/src/clp_ffi_py/ir/native/PyQuery.cpp +++ b/src/clp_ffi_py/ir/native/PyQuery.cpp @@ -1,5 +1,5 @@ -#include // Must always be included before any other header files +#include // Must be included before any other header files #include "PyQuery.hpp" diff --git a/src/clp_ffi_py/ir/native/PyQuery.hpp b/src/clp_ffi_py/ir/native/PyQuery.hpp index 970a51b3..ddf140eb 100644 --- a/src/clp_ffi_py/ir/native/PyQuery.hpp +++ b/src/clp_ffi_py/ir/native/PyQuery.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_IR_NATIVE_PYQUERY_HPP #define CLP_FFI_PY_IR_NATIVE_PYQUERY_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include #include diff --git a/src/clp_ffi_py/ir/native/PySerializer.cpp b/src/clp_ffi_py/ir/native/PySerializer.cpp index 7b473451..88f79e08 100644 --- a/src/clp_ffi_py/ir/native/PySerializer.cpp +++ b/src/clp_ffi_py/ir/native/PySerializer.cpp @@ -1,4 +1,4 @@ -#include // Must always be included before any other header files +#include // Must be included before any other header files #include "PySerializer.hpp" diff --git a/src/clp_ffi_py/ir/native/PySerializer.hpp b/src/clp_ffi_py/ir/native/PySerializer.hpp index c5cecb40..57d736e9 100644 --- a/src/clp_ffi_py/ir/native/PySerializer.hpp +++ b/src/clp_ffi_py/ir/native/PySerializer.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_IR_NATIVE_PYSERIALIZER_HPP #define CLP_FFI_PY_IR_NATIVE_PYSERIALIZER_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include #include diff --git a/src/clp_ffi_py/ir/native/deserialization_methods.cpp b/src/clp_ffi_py/ir/native/deserialization_methods.cpp index de1ec43e..5d14ea48 100644 --- a/src/clp_ffi_py/ir/native/deserialization_methods.cpp +++ b/src/clp_ffi_py/ir/native/deserialization_methods.cpp @@ -1,4 +1,4 @@ -#include // Must always be included before any other header files +#include // Must be included before any other header files #include "deserialization_methods.hpp" diff --git a/src/clp_ffi_py/ir/native/deserialization_methods.hpp b/src/clp_ffi_py/ir/native/deserialization_methods.hpp index ecdf56ec..fc538994 100644 --- a/src/clp_ffi_py/ir/native/deserialization_methods.hpp +++ b/src/clp_ffi_py/ir/native/deserialization_methods.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_IR_NATIVE_DESERIALIZATION_METHODS #define CLP_FFI_PY_IR_NATIVE_DESERIALIZATION_METHODS -#include // Must always be included before any other header files +#include // Must be included before any other header files // Documentation for these methods is in clp/ir/native/PyDeserializer.cpp, as it also serves as the // documentation for Python. diff --git a/src/clp_ffi_py/ir/native/serialization_methods.cpp b/src/clp_ffi_py/ir/native/serialization_methods.cpp index 81a6ae00..fe9ca613 100644 --- a/src/clp_ffi_py/ir/native/serialization_methods.cpp +++ b/src/clp_ffi_py/ir/native/serialization_methods.cpp @@ -1,4 +1,4 @@ -#include // Must always be included before any other header files +#include // Must be included before any other header files #include "serialization_methods.hpp" diff --git a/src/clp_ffi_py/ir/native/serialization_methods.hpp b/src/clp_ffi_py/ir/native/serialization_methods.hpp index 44f83c6c..d66c3715 100644 --- a/src/clp_ffi_py/ir/native/serialization_methods.hpp +++ b/src/clp_ffi_py/ir/native/serialization_methods.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_IR_NATIVE_SERIALIZATION_METHODS #define CLP_FFI_PY_IR_NATIVE_SERIALIZATION_METHODS -#include // Must always be included before any other header files +#include // Must be included before any other header files // Documentation for these methods is in clp_ffi_py/ir/native/PyFourByteSerializer.cpp, as it also // serves as the documentation for python. diff --git a/src/clp_ffi_py/modules/ir_native.cpp b/src/clp_ffi_py/modules/ir_native.cpp index 11be2ab8..35337515 100644 --- a/src/clp_ffi_py/modules/ir_native.cpp +++ b/src/clp_ffi_py/modules/ir_native.cpp @@ -1,4 +1,4 @@ -#include // Must always be included before any other header files +#include // Must be included before any other header files #include #include diff --git a/src/clp_ffi_py/utils.cpp b/src/clp_ffi_py/utils.cpp index 0d87fd8b..3d85b8b5 100644 --- a/src/clp_ffi_py/utils.cpp +++ b/src/clp_ffi_py/utils.cpp @@ -1,4 +1,4 @@ -#include // Must always be included before any other header files +#include // Must be included before any other header files #include "utils.hpp" @@ -7,8 +7,8 @@ #include #include -#include #include +#include #include #include diff --git a/src/clp_ffi_py/utils.hpp b/src/clp_ffi_py/utils.hpp index ad6ae2ba..fcde9733 100644 --- a/src/clp_ffi_py/utils.hpp +++ b/src/clp_ffi_py/utils.hpp @@ -1,7 +1,7 @@ #ifndef CLP_FFI_PY_UTILS_HPP #define CLP_FFI_PY_UTILS_HPP -#include // Must always be included before any other header files +#include // Must be included before any other header files #include #include @@ -12,8 +12,8 @@ #include #include -#include #include +#include namespace clp_ffi_py { /** diff --git a/src/clp_ffi_py/Python.hpp b/src/wrapped_dependency_headers/Python.hpp similarity index 94% rename from src/clp_ffi_py/Python.hpp rename to src/wrapped_dependency_headers/Python.hpp index a5570fff..381a4abc 100644 --- a/src/clp_ffi_py/Python.hpp +++ b/src/wrapped_dependency_headers/Python.hpp @@ -5,9 +5,11 @@ * 1. https://docs.python.org/3/c-api/intro.html#include-files * 2. https://docs.python.org/3/c-api/arg.html#strings-and-buffers */ +// IWYU pragma: begin_exports #define PY_SSIZE_T_CLEAN #include #include +// IWYU pragma: end_exports // clang-format off #ifdef CLP_FFI_PY_ENABLE_LINTING diff --git a/src/wrapped_dependency_headers/msgpack.hpp b/src/wrapped_dependency_headers/msgpack.hpp new file mode 100644 index 00000000..09b4e632 --- /dev/null +++ b/src/wrapped_dependency_headers/msgpack.hpp @@ -0,0 +1,13 @@ +// IWYU pragma: begin_exports +#define PY_SSIZE_T_CLEAN +#include +// IWYU pragma: end_exports + +// clang-format off +#ifdef CLP_FFI_PY_ENABLE_LINTING +// Inform IWYU of the headers that we use that are exported by msgpack.hpp +// IWYU pragma: begin_exports +// TODO: add necessary msgpack internal headers to silent clang-tidy warnings +// IWYU pragma: end_exports +#endif +// clang-format on