I've made several improvements to the repository to incorporate best …#2
Open
andreferra wants to merge 1 commit intomainfrom
Open
I've made several improvements to the repository to incorporate best …#2andreferra wants to merge 1 commit intomainfrom
andreferra wants to merge 1 commit intomainfrom
Conversation
…practices, examples, and sanitizers.
Here's a summary of the changes:
1. **Enhanced Documentation (`README.md`)**:
* I added a "Using the Library" section with a more complex example.
* I added a "Compiler Sanitizers" section explaining ASan, TSan, and UBSan, and how to enable them via CMake.
* I updated the "Build Configuration Options" table with sanitizer flags.
* I improved the overall document structure and clarity.
2. **CMake Sanitizer Support (`CMakeLists.txt`)**:
* I added CMake options (`ENABLE_ASAN`, `ENABLE_TSAN`, `ENABLE_UBSAN`) to enable AddressSanitizer, ThreadSanitizer, and UndefinedBehaviorSanitizer.
* I implemented logic to apply appropriate compiler/linker flags.
* I handled mutual exclusivity between TSan and ASan/UBSan.
3. **GitHub Actions Workflow Update (`.github/workflows/main.yml`)**:
* I added new jobs to build and test the project with ASan, UBSan, ASan+UBSan, and TSan enabled, in addition to the default build.
4. **New Example Application and Library Enhancement**:
* I added a new library function `Lib::processData(const std::string& data)` to `lib.hpp` and `lib.cpp`.
* I created a new example application `app/advanced_main.cpp` that demonstrates the usage of `Lib::processData`.
* I updated `app/CMakeLists.txt` to build the new `advanced_app` executable.
These changes aim to improve the developer experience, code quality, and CI capabilities of the project template.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces several enhancements to the repository by adding sanitizer support in CMake, new library functionality with an accompanying advanced example application, and improved documentation.
- New library function Lib::processData and an example usage in app/advanced_main.cpp
- Added CMake options for ASan, TSan, and UBSan with mutual exclusivity handling
- A comprehensive update of the README.md to include build instructions, usage examples, and sanitizer configuration
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib.cpp | Added a new function processData and an include for |
| include/lib.hpp | Updated header to declare processData |
| app/advanced_main.cpp | Introduced an example application to demonstrate library usage |
| app/CMakeLists.txt | Added target for advanced_app linking against the library |
| README.md | Expanded documentation with new sections covering usage and sanitizers |
| CMakeLists.txt | Added options and configuration for multiple compiler sanitizers |
| .github/workflows/main.yml | Updated CI workflows to build/test with various sanitizer configurations |
Comments suppressed due to low confidence (2)
README.md:88
- The README example uses '#include "lib.h"' whereas the updated header file is 'lib.hpp'. Consider updating the example to avoid potential confusion.
#include "lib.h" // Main header for your library (ProjectTemplate::Lib)
app/advanced_main.cpp:1
- Although the example compiles via transitive includes, explicitly including in advanced_main.cpp would improve code clarity and ensure std::string is defined.
#include <iostream>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…practices, examples, and sanitizers.
Here's a summary of the changes:
Enhanced Documentation (
README.md):CMake Sanitizer Support (
CMakeLists.txt):ENABLE_ASAN,ENABLE_TSAN,ENABLE_UBSAN) to enable AddressSanitizer, ThreadSanitizer, and UndefinedBehaviorSanitizer.GitHub Actions Workflow Update (
.github/workflows/main.yml):New Example Application and Library Enhancement:
Lib::processData(const std::string& data)tolib.hppandlib.cpp.app/advanced_main.cppthat demonstrates the usage ofLib::processData.app/CMakeLists.txtto build the newadvanced_appexecutable.These changes aim to improve the developer experience, code quality, and CI capabilities of the project template.