Skip to content
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

Merged
merged 5 commits into from
Dec 3, 2024

Conversation

LinZhihao-723
Copy link
Member

@LinZhihao-723 LinZhihao-723 commented Dec 2, 2024

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:

  • Python: this is simply moving the original Python header from clp_ffi_py to wrapped_dependency_headers
  • msgpack: this header is new. The import section still needs to be filled by future PRs that resolve clang-tidy warnings.

Related changes:

  • The new wrapped headers are used to replace existing headers.
  • clang-format config file is changed accordingly.
  • cmake list is changed to include wrapped headers as sources
  • lint task is changed to also run clang-tidy against wrapped headers

Validation performed

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced new header management for Python and msgpack dependencies, enhancing project organization.
    • Added support for Include What You Use (IWYU) tool in wrapped facade headers.
  • Bug Fixes

    • Improved error handling in PyMetadata_init to prevent segmentation faults.
  • Documentation

    • Enhanced comments for clarity on header dependencies and linting support.

These changes aim to streamline dependency management and improve the robustness of Python integration within the project.

Copy link

coderabbitai bot commented Dec 2, 2024

Walkthrough

The 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 CMakeLists.txt, while the linting setup is expanded to include new directories. Multiple source files are updated to change the inclusion path for the Python.hpp header, reflecting a reorganization of dependencies. Additionally, comments for the Include What You Use (IWYU) tool are added to header files to improve dependency management.

Changes

File Path Change Summary
CMakeLists.txt Added variables CLP_FFI_PY_WRAPPED_FACADE_HEADERS_DIR and CLP_FFI_PY_WRAPPED_FACADE_HEADERS; removed Python.hpp from CLP_FFI_PY_LIB_IR_SOURCES.
lint-tasks.yml Added variable G_CPP_WRAPPED_FACADE_HEADERS_DIR and updated G_CPP_LINT_DIRS to include it.
src/clp_ffi_py/.clang-format Updated regex patterns for header file inclusion.
src/clp_ffi_py/PyExceptionContext.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/PyObjectCast.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/PyObjectUtils.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/Py_utils.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp> and <msgpack.hpp> to <wrapped_facade_headers/msgpack.hpp>.
src/clp_ffi_py/Py_utils.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp> and <msgpack.hpp> to <wrapped_facade_headers/msgpack.hpp>.
src/clp_ffi_py/ir/native/DeserializerBufferReader.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/DeserializerBufferReader.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyDeserializer.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyDeserializer.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyDeserializerBuffer.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyDeserializerBuffer.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyFourByteDeserializer.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyFourByteDeserializer.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyFourByteSerializer.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyFourByteSerializer.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyLogEvent.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyLogEvent.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyMetadata.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyMetadata.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyQuery.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PyQuery.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PySerializer.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/PySerializer.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/deserialization_methods.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/deserialization_methods.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/serialization_methods.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/ir/native/serialization_methods.hpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/clp_ffi_py/modules/ir_native.cpp Updated include directive from <clp_ffi_py/Python.hpp> to <wrapped_facade_headers/Python.hpp>.
src/wrapped_facade_headers/Python.hpp Added IWYU pragmas for managing exported headers.
src/wrapped_facade_headers/msgpack.hpp Added IWYU pragmas for managing exported headers.

Possibly related PRs

Suggested reviewers

  • kirkrodrigues
  • haiqi96

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between e6e1fad and 98d6366.

📒 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_facade_headers/Python.hpp (1 hunks)
  • src/wrapped_facade_headers/msgpack.hpp (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • src/wrapped_facade_headers/msgpack.hpp
  • src/wrapped_facade_headers/Python.hpp
🚧 Files skipped from review as they are similar to previous changes (35)
  • src/clp_ffi_py/ir/native/deserialization_methods.hpp
  • src/clp_ffi_py/ir/native/PyDeserializer.hpp
  • src/clp_ffi_py/ir/native/serialization_methods.hpp
  • src/clp_ffi_py/ir/native/PySerializer.hpp
  • src/clp_ffi_py/ir/native/DeserializerBufferReader.hpp
  • src/clp_ffi_py/ir/native/PyDeserializerBuffer.hpp
  • src/clp_ffi_py/ir/native/PyLogEvent.hpp
  • src/clp_ffi_py/PyObjectUtils.hpp
  • src/clp_ffi_py/Py_utils.hpp
  • src/clp_ffi_py/ir/native/PyFourByteSerializer.cpp
  • src/clp_ffi_py/ir/native/PyFourByteSerializer.hpp
  • src/clp_ffi_py/ir/native/PyFourByteDeserializer.cpp
  • src/clp_ffi_py/ir/native/PyFourByteDeserializer.hpp
  • src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.cpp
  • src/clp_ffi_py/ir/native/DeserializerBufferReader.cpp
  • src/clp_ffi_py/ir/native/PySerializer.cpp
  • src/clp_ffi_py/ir/native/PyKeyValuePairLogEvent.hpp
  • src/clp_ffi_py/ir/native/PyDeserializerBuffer.cpp
  • src/clp_ffi_py/utils.cpp
  • src/clp_ffi_py/ir/native/PyDeserializer.cpp
  • src/clp_ffi_py/ir/native/PyMetadata.hpp
  • CMakeLists.txt
  • src/clp_ffi_py/ir/native/serialization_methods.cpp
  • src/clp_ffi_py/PyObjectCast.hpp
  • src/clp_ffi_py/PyExceptionContext.hpp
  • src/clp_ffi_py/ir/native/PyQuery.hpp
  • src/clp_ffi_py/ir/native/PyLogEvent.cpp
  • src/clp_ffi_py/utils.hpp
  • src/clp_ffi_py/Py_utils.cpp
  • lint-tasks.yml
  • src/clp_ffi_py/modules/ir_native.cpp
  • src/clp_ffi_py/ir/native/PyMetadata.cpp
  • src/clp_ffi_py/.clang-format
  • src/clp_ffi_py/ir/native/PyQuery.cpp
  • src/clp_ffi_py/ir/native/deserialization_methods.cpp

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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 documentation

While 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

📥 Commits

Reviewing files that changed from the base of the PR and between d41d623 and 38b98f2.

📒 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.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
src/wrapped_dependency_headers/msgpack.hpp Outdated Show resolved Hide resolved
src/wrapped_dependency_headers/msgpack.hpp Outdated Show resolved Hide resolved
src/clp_ffi_py/.clang-format Outdated Show resolved Hide resolved
src/clp_ffi_py/.clang-format Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@LinZhihao-723 LinZhihao-723 changed the title build: Add wrappers for dependency libraries' headers for linting purposes. build: Add facade wrappers for dependency libraries' headers for linting purposes. Dec 3, 2024
@LinZhihao-723 LinZhihao-723 changed the title build: Add facade wrappers for dependency libraries' headers for linting purposes. build: Add facade wrapper headers for dependency libraries to silence clang-tidy warnings. Dec 3, 2024
Copy link
Member

@kirkrodrigues kirkrodrigues left a 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.

@LinZhihao-723 LinZhihao-723 changed the title build: Add facade wrapper headers for dependency libraries to silence clang-tidy warnings. build: Wrap dependency libraries' facade headers with IWYU exports to resolve clang-tidy violations. Dec 3, 2024
@LinZhihao-723 LinZhihao-723 merged commit a07a7cd into y-scope:main Dec 3, 2024
65 of 67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants