Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves developer ergonomics for ST-LIB by standardizing on CMake presets for simulator-focused builds/tests, adding dedicated documentation, and tightening CI/editor tooling while applying repo-wide formatting cleanup.
Changes:
- Added new developer documentation for setup/build/testing and updated README quickstart to use presets.
- Migrated local scripts + CI test workflow to CMake/CTest presets (including a new
simulator-asanpath). - Cleaned up tooling/config (pre-commit hooks, VS Code settings) and removed devcontainer support.
Reviewed changes
Copilot reviewed 20 out of 57 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/tar_tests.sh | Simplifies test artifact archiving for simulator output. |
| tools/run_sim_tests.sh | Switches simulator test runs to CMake/CTest presets. |
| tools/init-submodules.sh | Minor formatting cleanup. |
| tools/build.sh | Reworks build wrapper around CMake presets (+ optional test run). |
| tools/build.py | Replaces env/flag-based build logic with preset-based wrapper. |
| toolchains/stm32.cmake | Minor formatting cleanup. |
| startup_stm32h723zgtx.s | Whitespace cleanup. |
| docs/testing.md | Adds preset-based testing instructions (incl. ASAN). |
| docs/setup.md | Adds setup instructions (submodules + pre-commit). |
| docs/build-and-presets.md | Documents key presets and helper scripts. |
| ci/Dockerfile | Minor formatting cleanup. |
| Tests/CMakeLists.txt | Updates googletest fetch method, test target props, and links sim dev flags when present. |
| Src/ST-LIB_LOW/Sd/Sd.cpp | Formatting cleanup only. |
| Src/ST-LIB_HIGH/Protections/Boundary.cpp | Formatting cleanup only. |
| Src/MockedDrivers/mocked_ll_tim.cpp | Formatting cleanup only. |
| Src/MockedDrivers/NVIC.cpp | Formatting cleanup only. |
| Src/HALAL/Services/Watchdog/Watchdog.cpp | Formatting cleanup only. |
| Src/HALAL/Services/Time/RTC.cpp | Formatting cleanup only. |
| Src/HALAL/Services/PWM/DualCenterPWM/DualCenterPWM.cpp | Formatting cleanup only. |
| Src/HALAL/Services/DigitalOutputService/DigitalOutputService.cpp | Formatting cleanup only. |
| Src/HALAL/Services/Communication/SPI/SPI.cpp | Formatting cleanup only. |
| Src/HALAL/Services/Communication/I2C/I2C.cpp | Formatting cleanup only. |
| Src/HALAL/Services/ADC/ADC.cpp | Formatting cleanup only. |
| Src/HALAL/Models/SPI/SPI2.cpp | Formatting cleanup only. |
| Src/HALAL/Models/DMA/DMA.cpp | Formatting cleanup only. |
| STM32H723ZGTX_RAM.ld | Whitespace cleanup. |
| STM32H723ZGTX_FLASH.ld | Whitespace cleanup. |
| README.md | Updates overview/quickstart and links new docs. |
| Inc/STM32CubeH7Wrapper/stm32h7xx_ll_tim_wrapper.h | Formatting cleanup only. |
| Inc/ST-LIB_LOW/Sensors/EncoderSensor/NewEncoderSensor.hpp | Formatting cleanup only. |
| Inc/MockedDrivers/compiler_specific.hpp | Formatting cleanup only. |
| Inc/MockedDrivers/Register.hpp | Formatting cleanup only. |
| Inc/MockedDrivers/NVIC.hpp | Formatting cleanup only. |
| Inc/HALAL/Services/Time/RTC.hpp | Formatting cleanup only. |
| Inc/HALAL/Services/PWM/DualCenterPWM/DualCenterPWM.hpp | Formatting cleanup only. |
| Inc/HALAL/Services/FMAC/FMAC.hpp | Formatting cleanup only. |
| Inc/HALAL/Services/Encoder/NewEncoder.hpp | Formatting cleanup only. |
| Inc/HALAL/Services/Communication/SPI/SPI.hpp | Formatting cleanup only. |
| Inc/HALAL/Services/Communication/I2C/I2C.hpp | Formatting cleanup only. |
| Inc/HALAL/Services/Communication/Ethernet/PHY/phy_driver.h | Formatting cleanup only. |
| Inc/HALAL/Services/ADC/ADC.hpp | Formatting cleanup only. |
| Inc/HALAL/Models/TimerDomain/TimerDomain.hpp | Minor formatting cleanup. |
| Inc/HALAL/Models/SPI/SPI2.hpp | Formatting cleanup only. |
| Inc/HALAL/Models/Packets/MdmaPacket.hpp | Formatting cleanup only. |
| Inc/HALAL/Models/DMA/DMA2.hpp | Adds fallback return to satisfy control-flow/constexpr requirements. |
| Inc/HALAL/Models/DMA/DMA.hpp | Formatting cleanup only. |
| Inc/HALAL/Benchmarking_toolkit/DataWatchpointTrace/DataWatchpointTrace.hpp | Formatting cleanup only. |
| Inc/C++Utilities/Stack.hpp | Formatting cleanup only. |
| CMakePresets.json | Adds simulator-asan configure/build preset and new test presets. |
| CMakeLists.txt | Adds sanitizer option + interface flags library for non-cross builds. |
| .vscode/settings.json | Updates formatting defaults, sets CMake default presets, cleans associations. |
| .vscode/c_cpp_properties.json | Minor formatting cleanup. |
| .pre-commit-config.yaml | Adds core pre-commit hooks for conflict/whitespace/EOF. |
| .github/workflows/tests.yml | Migrates CI simulator test job to presets. |
| .github/workflows/build.yml | Minor whitespace cleanup. |
| .devcontainer/devcontainer.json | Removes devcontainer support (intentional). |
| .devcontainer/Dockerfile | Removes devcontainer support (intentional). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 57 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def run_cmd(cmd: list[str]) -> int: | ||
| return subprocess.call(cmd, cwd=REPO_ROOT) |
There was a problem hiding this comment.
run_cmd uses cmd: list[str] as a type annotation. This requires Python 3.9+ unless from __future__ import annotations is enabled; on Python 3.8 this will raise a TypeError at import time. Either switch to List[str] from typing, add the future import, or document/enforce a Python>=3.9 requirement in the repo docs/tooling.
This PR improves DX and maintenance workflows in ST-LIB, focused on setup/build/test clarity and simulator-oriented usage.
Main Changes
.devcontainer/).docs/setup.mddocs/build-and-presets.mddocs/testing.mdREADME.mdupdated to link docs and quickstart.CMakePresets.jsonandCMakeLists.txtimprovements.Tests/CMakeLists.txtupdates for simulator workflow.tools/build.pytools/build.shtools/run_sim_tests.shtools/tar_tests.sh.github/workflows/tests.yml.vscode/settings.json.pre-commit-config.yamlNotes