-
Notifications
You must be signed in to change notification settings - Fork 6
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
Replace C++ linting configs with those managed by yscope-dev-utils; Forcibly enable CMAKE_EXPORT_COMPILE_COMMANDS
.
#15
Conversation
…utils; Forcibly enable CMAKE_EXPORT_COMPILE_COMMANDs.
WalkthroughThe pull request introduces several modifications across multiple files. Key changes include updates to the Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (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 (
|
CMAKE_EXPORT_COMPILE_COMMAND
s.CMAKE_EXPORT_COMPILE_COMMANDS
.
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 (4)
README.md (2)
37-40
: Good addition of Emscripten installation step.The inclusion of the Emscripten installation command is beneficial. However, it would be helpful to briefly explain what Emscripten is and why it's necessary for the project. This context would assist new contributors in understanding the project's requirements better.
Consider adding a brief explanation, such as:
# Emscripten is required for compiling C++ to WebAssembly Download and install [emscripten]:
42-46
: Great addition of C++ linting setup step.This new step for setting up C++ linting tool configs directly addresses the PR objectives and provides clear instructions for contributors. It's well-explained and easy to follow.
For consistency with the Emscripten step, consider adding a brief explanation of why this step is necessary. For example:
# Set up the config files for our C++ linting tools to ensure code quality and consistency Set up the config files for our C++ linting tools:
CMakeLists.txt (2)
29-38
: LGTM! Consider adding a comment explaining the clang-tidy limitation.The changes to forcibly enable
CMAKE_EXPORT_COMPILE_COMMANDS
and disable response files for clang-tidy are well-implemented and align with the PR objectives. These modifications will ensure consistent behaviour across different CMake versions and improve compatibility with clang-tidy.Consider adding a brief comment explaining why response files are disabled for clang-tidy. This would help future maintainers understand the reasoning behind this configuration. For example:
# Disable response files since clang-tidy doesn't support them # This ensures that include directories are passed directly to clang-tidy set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES OFF)
Incomplete C++ Linting Configuration Updates
- Found
.clang-format
in./src/clp_ffi_js/
, but other linting configuration files (clang-tidy
,cpplint
) are missing.- The
lint:cpp-configs
task is not present inpackage.json
.Please ensure all C++ linting configurations and tasks are properly added to meet the PR objectives.
🔗 Analysis chain
Line range hint
1-38
: Verify the C++ linting configuration updates.The changes to enable compile commands and disable response files for clang-tidy are implemented correctly. However, the PR objectives mention updating C++ linting configurations, which are not directly visible in this CMakeLists.txt file.
To ensure all aspects of the PR objectives are met, please run the following script to verify the C++ linting configuration updates:
This script will help verify that the C++ linting configuration updates mentioned in the PR objectives have been implemented correctly.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify C++ linting configuration updates # Check for the existence of C++ linting configuration files echo "Checking for C++ linting configuration files:" fd -e yml -e yaml -e json . | grep -E '(clang-tidy|clang-format|cpplint)' # Check for the new lint:cpp-configs task echo "Checking for the new lint:cpp-configs task:" grep -n "lint:cpp-configs" package.json # Verify symlinks to C++ linting configurations echo "Verifying symlinks to C++ linting configurations:" find . -type l -name "*clang-tidy*" -o -name "*clang-format*" -o -name "*cpplint*"Length of output: 538
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (7)
- .gitignore (1 hunks)
- CMakeLists.txt (1 hunks)
- README.md (1 hunks)
- lint-tasks.yml (1 hunks)
- src/clp_ffi_js/.clang-format (1 hunks)
- src/clp_ffi_js/.clang-tidy (0 hunks)
- tools/yscope-dev-utils (1 hunks)
💤 Files with no reviewable changes (1)
- src/clp_ffi_js/.clang-tidy
✅ Files skipped from review due to trivial changes (3)
- .gitignore
- src/clp_ffi_js/.clang-format
- tools/yscope-dev-utils
🔇 Additional comments (5)
lint-tasks.yml (3)
15-16
: LGTM: New task for C++ linting configurations added successfully.The new
cpp-configs
task has been correctly added to thelint-tasks.yml
file. It executes a shell script that creates symlinks for C++ lint configurations, which aligns with the PR objectives. The use of the{{.ROOT_DIR}}
variable ensures portability across different environments.
Line range hint
18-23
: Indentation correction improves YAML structure.The indentation of the
aliases
section under theyml
task has been corrected. This improvement ensures that theyml-check
andyml-fix
aliases are properly associated with theyml
task. The fix enhances the readability and maintainability of the configuration file while preventing potential parsing issues.
Line range hint
1-55
: Summary: Changes align well with PR objectives.The modifications to
lint-tasks.yml
successfully implement the required updates for C++ linting configurations and improve the overall structure of the file. The addition of thecpp-configs
task and the correction of indentation in theyml
task contribute to better maintainability and functionality of the linting process.These changes align perfectly with the PR objectives of incorporating the latest C++ linting configurations and processes from the yscope-dev-utils repository. The new task will facilitate the generation of symlinks to the C++ linting configurations, as intended.
README.md (2)
35-36
: Excellent addition to the setup instructions.This new instruction provides clarity for developers, ensuring they complete all necessary setup steps before opening the project in an IDE. It's a good practice to have these steps clearly outlined.
35-46
: Overall, excellent improvements to the README.The changes made to the README file significantly enhance the setup instructions for the project. The addition of explicit steps for installing Emscripten and setting up C++ linting configs aligns well with the PR objectives and provides clearer guidance for contributors. These improvements will likely reduce setup issues and ensure more consistent code quality across contributions.
While the changes are already very good, the minor suggestions provided for adding brief explanations could further improve the document's clarity. Great work on enhancing the project's documentation!
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.
Verified on a Mac ARM computer and observed the realpath
issue no long exists after git checking out the yscope-dev-utils version in this PR.
For the PR title to be used as the final commit message, how about:
Replace C++ linting configs with those managed by yscope-dev-utils; Forcibly enable `CMAKE_EXPORT_COMPILE_COMMANDS`.
CMAKE_EXPORT_COMPILE_COMMANDS
.CMAKE_EXPORT_COMPILE_COMMANDS
.
Description
We recently added the C++ linting configs we use across our repos to yscope-dev-utils, as well as a process for using them while allowing repo-specific overrides. Thus, this PR updates to use them and the process. To set them up, this PR adds the task
lint:cpp-configs
.This PR also forcibly enables
CMAKE_EXPORT_COMPILE_COMMANDS
. Previously, we had written the code such thatCMAKE_EXPORT_COMPILE_COMMANDS
would only be set if it wasn't already set, but for some CMake versions (e.g., 3.16.3), it defaults toOFF
rather than being unset. Forcibly enabling it should have no known downsidesValidation performed
task lint:cpp-configs
generated symlinks to the C++ linting configs.task lint:cpp-check
succeeded.task lint:cpp-check
detected the error.task lint:cpp-fix
fixed the error.Summary by CodeRabbit
Summary by CodeRabbit
Release Notes
New Features
Improvements
.clang-format
configuration for a more standardized formatting approach.Bug Fixes
lint-tasks.yml
file.Chores
yscope-dev-utils
subproject..gitignore
file to ignore specific lint configuration files.