-
Notifications
You must be signed in to change notification settings - Fork 5
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
build: Wrap dependency libraries' facade headers with IWYU exports to resolve clang-tidy violations. #100
build: Wrap dependency libraries' facade headers with IWYU exports to resolve clang-tidy violations. #100
Conversation
WalkthroughThe pull request introduces modifications to several files, primarily focusing on updating header file inclusions and enhancing CMake and linting configurations. A new variable for managing third-party facade headers is added in Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (37)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (35)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
CMakeLists.txt (1)
135-140
: Consider enhancing header documentationWhile the comment explains the purpose well, consider adding more detailed documentation about:
- The relationship between these wrappers and their original headers
- Any specific clang-tidy warnings being addressed
# NOTE: these headers are wrappers of third-party dependency libraries. They are required to silent # clang-tidy warnings for missing direct includes. +# These wrappers ensure proper include order and silence specific warnings: +# - msgpack.hpp: Wraps msgpack-c headers to handle missing include warnings +# - Python.hpp: Wraps Python.h to handle system header include warnings 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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (37)
CMakeLists.txt
(2 hunks)lint-tasks.yml
(2 hunks)src/clp_ffi_py/.clang-format
(1 hunks)src/clp_ffi_py/PyExceptionContext.hpp
(1 hunks)src/clp_ffi_py/PyObjectCast.hpp
(1 hunks)src/clp_ffi_py/PyObjectUtils.hpp
(1 hunks)src/clp_ffi_py/Py_utils.cpp
(1 hunks)src/clp_ffi_py/Py_utils.hpp
(1 hunks)src/clp_ffi_py/ir/native/DeserializerBufferReader.cpp
(1 hunks)src/clp_ffi_py/ir/native/DeserializerBufferReader.hpp
(1 hunks)src/clp_ffi_py/ir/native/PyDeserializer.cpp
(1 hunks)src/clp_ffi_py/ir/native/PyDeserializer.hpp
(1 hunks)src/clp_ffi_py/ir/native/PyDeserializerBuffer.cpp
(1 hunks)src/clp_ffi_py/ir/native/PyDeserializerBuffer.hpp
(1 hunks)src/clp_ffi_py/ir/native/PyFourByteDeserializer.cpp
(1 hunks)src/clp_ffi_py/ir/native/PyFourByteDeserializer.hpp
(1 hunks)src/clp_ffi_py/ir/native/PyFourByteSerializer.cpp
(1 hunks)src/clp_ffi_py/ir/native/PyFourByteSerializer.hpp
(1 hunks)src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.cpp
(1 hunks)src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.hpp
(1 hunks)src/clp_ffi_py/ir/native/PyLogEvent.cpp
(1 hunks)src/clp_ffi_py/ir/native/PyLogEvent.hpp
(1 hunks)src/clp_ffi_py/ir/native/PyMetadata.cpp
(1 hunks)src/clp_ffi_py/ir/native/PyMetadata.hpp
(1 hunks)src/clp_ffi_py/ir/native/PyQuery.cpp
(1 hunks)src/clp_ffi_py/ir/native/PyQuery.hpp
(1 hunks)src/clp_ffi_py/ir/native/PySerializer.cpp
(1 hunks)src/clp_ffi_py/ir/native/PySerializer.hpp
(1 hunks)src/clp_ffi_py/ir/native/deserialization_methods.cpp
(1 hunks)src/clp_ffi_py/ir/native/deserialization_methods.hpp
(1 hunks)src/clp_ffi_py/ir/native/serialization_methods.cpp
(1 hunks)src/clp_ffi_py/ir/native/serialization_methods.hpp
(1 hunks)src/clp_ffi_py/modules/ir_native.cpp
(1 hunks)src/clp_ffi_py/utils.cpp
(2 hunks)src/clp_ffi_py/utils.hpp
(2 hunks)src/wrapped_dependency_headers/Python.hpp
(1 hunks)src/wrapped_dependency_headers/msgpack.hpp
(1 hunks)
✅ Files skipped from review due to trivial changes (34)
- src/clp_ffi_py/ir/native/deserialization_methods.hpp
- src/clp_ffi_py/ir/native/serialization_methods.hpp
- src/clp_ffi_py/ir/native/PyDeserializer.hpp
- src/clp_ffi_py/ir/native/PyFourByteDeserializer.hpp
- src/clp_ffi_py/Py_utils.hpp
- src/wrapped_dependency_headers/msgpack.hpp
- src/clp_ffi_py/ir/native/PySerializer.hpp
- src/clp_ffi_py/ir/native/PyFourByteSerializer.hpp
- src/clp_ffi_py/ir/native/PyDeserializerBuffer.hpp
- src/wrapped_dependency_headers/Python.hpp
- src/clp_ffi_py/ir/native/DeserializerBufferReader.hpp
- src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.hpp
- src/clp_ffi_py/ir/native/PyMetadata.hpp
- src/clp_ffi_py/PyObjectUtils.hpp
- src/clp_ffi_py/ir/native/PyQuery.hpp
- src/clp_ffi_py/PyExceptionContext.hpp
- src/clp_ffi_py/utils.hpp
- src/clp_ffi_py/ir/native/serialization_methods.cpp
- src/clp_ffi_py/ir/native/PyLogEvent.hpp
- src/clp_ffi_py/ir/native/PyFourByteDeserializer.cpp
- src/clp_ffi_py/modules/ir_native.cpp
- src/clp_ffi_py/utils.cpp
- src/clp_ffi_py/ir/native/PyDeserializer.cpp
- src/clp_ffi_py/Py_utils.cpp
- src/clp_ffi_py/ir/native/PySerializer.cpp
- src/clp_ffi_py/ir/native/PyLogEvent.cpp
- src/clp_ffi_py/ir/native/PyDeserializerBuffer.cpp
- src/clp_ffi_py/ir/native/DeserializerBufferReader.cpp
- src/clp_ffi_py/.clang-format
- src/clp_ffi_py/ir/native/PyFourByteSerializer.cpp
- src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.cpp
- src/clp_ffi_py/PyObjectCast.hpp
- src/clp_ffi_py/ir/native/PyQuery.cpp
- src/clp_ffi_py/ir/native/deserialization_methods.cpp
🔇 Additional comments (5)
src/clp_ffi_py/ir/native/PyMetadata.cpp (1)
1-1
: Verify the wrapped Python header setup
The header path change aligns with the PR objectives to wrap dependency headers. However, we should verify the proper setup of the new header location.
✅ Verification successful
Header path change is properly configured
The Python header is correctly set up in the new location:
- The wrapped header exists at
src/wrapped_dependency_headers/Python.hpp
- The CMake configuration properly includes the new header path
- The header is consistently used across 30+ files in the codebase
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the wrapped Python header setup and its usage
# Check if the wrapped header exists and is properly set up
fd -t f "Python.hpp" wrapped_dependency_headers/
# Verify consistent header usage across the codebase
rg -l "wrapped_dependency_headers/Python\.hpp"
# Check CMake configuration for the new include path
fd -t f "CMakeLists.txt" | xargs rg "wrapped_dependency_headers"
Length of output: 1749
Script:
#!/bin/bash
# Check if the Python.hpp exists in the source directory
fd -t f "Python.hpp" src/
# Check if there's a wrapping mechanism for Python.hpp
rg -A 5 "Python\.hpp" src/clp_ffi_py/wrapped_dependency_headers/ || echo "Directory not found"
# Check the actual include path setup in build system
fd -t f "CMakeLists.txt" | xargs rg -A 3 "CLP_FFI_PY_WRAPPED_DEPENDENCY_HEADERS_DIR"
Length of output: 689
lint-tasks.yml (2)
7-10
: LGTM: Variable declarations are well-structured
The new variable G_CPP_WRAPPED_DEPENDENCY_HEADERS_DIR
and its inclusion in G_CPP_LINT_DIRS
properly set up the linting configuration for the wrapped dependency headers.
114-114
: Verify clang-tidy configuration for wrapped headers
The addition of wrapped headers directory to clang-tidy checks is appropriate. However, consider updating the TODO comment above to reflect the current state of clang-tidy violations in the wrapped headers.
✅ Verification successful
Let me gather more context about the TODO comment and clang-tidy configuration.
Let me try to find the correct path for the lint tasks configuration.
Based on the gathered information, I can now provide the final response:
TODO comment in msgpack.hpp accurately reflects current state
The TODO comment in msgpack.hpp
about silencing clang-tidy warnings aligns with the current configuration in lint-tasks.yml
. The lint tasks file shows that clang-tidy checks for wrapped headers were recently added, and the TODO comment in msgpack.hpp
correctly indicates that work is still needed to address these warnings. This is consistent with the phased approach mentioned in the lint-tasks.yml comment about gradually resolving clang-tidy violations.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for existing clang-tidy violations in wrapped headers
# Search for any existing clang-tidy-related comments or suppressions
rg -A 2 "NOLINT|clang-tidy" "src/wrapped_dependency_headers/"
Length of output: 303
Script:
#!/bin/bash
# Check the full context of the lint-tasks.yml file to understand the TODO and configuration
cat .github/workflows/lint-tasks.yml
Length of output: 103
Script:
#!/bin/bash
# Find the lint tasks configuration file
fd -t f "lint.*yml"
Length of output: 36
Script:
#!/bin/bash
# Check the content of the lint tasks file
cat lint-tasks.yml
# Also check for any clang-tidy configuration files
fd -t f "\.clang-tidy$"
Length of output: 6050
CMakeLists.txt (2)
60-60
: LGTM: Directory variable properly defined
The wrapped dependency headers directory is correctly defined relative to the source directory, following project conventions.
147-147
: LGTM: Source inclusion is correct
The wrapped dependency headers are properly included in the target sources, ensuring they're part of the build system and accessible for linting.
Co-authored-by: kirkrodrigues <[email protected]>
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.
For the PR title, how about:
build: Wrap dependency libraries' facade headers with IWYU exports to resolve clang-tidy violations.
Description
This PR is one of PRs for #96. It introduces wrapped facade wrappers for dependency libraries so that we can import their internal headers for linting purposes (to silence clang-tidy warnings). Currently, there are two dependency library headers wrapped:
clp_ffi_py
towrapped_dependency_headers
Related changes:
Validation performed
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
PyMetadata_init
to prevent segmentation faults.Documentation
These changes aim to streamline dependency management and improve the robustness of Python integration within the project.