Skip to content

I've made several improvements to the repository to incorporate best … - #2

Open
andreferra wants to merge 1 commit into
mainfrom
improve-repo-practices
Open

I've made several improvements to the repository to incorporate best …#2
andreferra wants to merge 1 commit into
mainfrom
improve-repo-practices

Conversation

@andreferra

Copy link
Copy Markdown
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 CopilotMay 24, 2025 15:17

CopilotAI left a comment

Copy link
Copy Markdown

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
FileDescription
src/lib.cppAdded a new function processData and an include for
include/lib.hppUpdated header to declare processData
app/advanced_main.cppIntroduced an example application to demonstrate library usage
app/CMakeLists.txtAdded target for advanced_app linking against the library
README.mdExpanded documentation with new sections covering usage and sanitizers
CMakeLists.txtAdded options and configuration for multiple compiler sanitizers
.github/workflows/main.ymlUpdated 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>

@andreferraandreferra self-assigned this May 24, 2025
Sign up for freeto 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

@andreferra