Skip to content

Conversation

@andreferra
Copy link
Owner

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

…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.
@andreferra andreferra requested a review from Copilot May 24, 2025 15:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@andreferra andreferra self-assigned this May 24, 2025
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