-
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
refactor: Fix clang-tidy warnings in PyQuery
to align with the latest C++ coding guideline.
#115
refactor: Fix clang-tidy warnings in PyQuery
to align with the latest C++ coding guideline.
#115
Conversation
WalkthroughThis pull request introduces changes to multiple files related to the Changes
Possibly related issues
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
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
🧹 Nitpick comments (1)
src/clp_ffi_py/ir/native/PyQuery.cpp (1)
Line range hint
305-308
: Useconst char
for keyword stringsThe keyword strings are not modified and should be declared as
const char
to improve code safety and clarity.Apply this diff to update the declarations:
-static char keyword_search_time_lower_bound[]{"search_time_lower_bound"}; -static char keyword_search_time_upper_bound[]{"search_time_upper_bound"}; -static char keyword_wildcard_queries[]{"wildcard_queries"}; -static char keyword_search_time_termination_margin[]{"search_time_termination_margin"}; +static const char keyword_search_time_lower_bound[]{"search_time_lower_bound"}; +static const char keyword_search_time_upper_bound[]{"search_time_upper_bound"}; +static const char keyword_wildcard_queries[]{"wildcard_queries"}; +static const char keyword_search_time_termination_margin[]{"search_time_termination_margin"};
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
lint-tasks.yml
(1 hunks)src/clp_ffi_py/ir/native/PyQuery.cpp
(10 hunks)src/clp_ffi_py/ir/native/PyQuery.hpp
(3 hunks)src/wrapped_facade_headers/Python.hpp
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
src/wrapped_facade_headers/Python.hpp (1)
Pattern **/*.{cpp,hpp,java,js,jsx,ts,tsx}
: - Prefer false == <expression>
rather than !<expression>
.
src/clp_ffi_py/ir/native/PyQuery.hpp (1)
Pattern **/*.{cpp,hpp,java,js,jsx,ts,tsx}
: - Prefer false == <expression>
rather than !<expression>
.
src/clp_ffi_py/ir/native/PyQuery.cpp (1)
Pattern **/*.{cpp,hpp,java,js,jsx,ts,tsx}
: - Prefer false == <expression>
rather than !<expression>
.
🪛 cppcheck (2.10-2)
src/clp_ffi_py/ir/native/PyQuery.cpp
[error] 485-485: Found an exit path from function with non-void return type that has missing return statement
(missingReturn)
🔇 Additional comments (5)
src/clp_ffi_py/ir/native/PyQuery.cpp (1)
359-362
: Deallocator implemented correctlyThe
PyQuery_dealloc
function properly cleans up resources and deletes the object, ensuring no memory leaks.src/wrapped_facade_headers/Python.hpp (1)
25-25
: Include<listobject.h>
for improved linting coverageAdding
<listobject.h>
ensures that linting tools have access to the definitions of list objects, which can help detect issues related to list operations.src/clp_ffi_py/ir/native/PyQuery.hpp (2)
49-56
: Properly delete constructors to prevent unintended usageDeleting the default constructor and copy/move constructors prevents direct instantiation and copying of
PyQuery
objects, which is appropriate given the class design.
97-99
: Confirm C++17 support forstatic inline
member variablesThe use of
static inline
for member variables requires C++17 or later. Please verify that the project is compiled with C++17 support to ensure compatibility.lint-tasks.yml (1)
126-127
: LGTM! The changes align with the PR objectives.The addition of PyQuery source files to the clang-tidy check list is well-structured and maintains consistency with existing entries.
Let's verify the existence of these files:
✅ Verification successful
The files exist in the expected location, eh!
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the PyQuery source files exist in the specified directory # Test: Check if the files exist fd -t f "PyQuery\.(cpp|hpp)$" src/clp_ffi_py/ir/native/Length of output: 131
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.
Can't find anything obvious
Description
NOTE: This PR depends on #116 to fix the cmake formatting issue.
This is one of the PR series trying to implement #96.
This PR fixes all clang-tidy warnings in
PyQuery
. Other than that, it also fixes the following problem:constexpr const char*
byconstexpr std::string_view
Validation performed
Summary by CodeRabbit
New Features
PyQuery
class functionality with new methods for Python integration.PyQuery
objects.Improvements
PyQuery
class.Chores