Conversation
…e, and datasaverspi
…lang-tidy b/c it causes lots of false positives
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens native (host) build/test quality gates by enabling aggressive compiler warnings, treating warnings as errors, adding sanitizers, and then updating production + test code to compile cleanly under those stricter settings.
Changes:
- Strengthen
platformio.ininative build flags (warnings-as-errors, extra warnings, sanitizers) and adjust clang-tidy configuration. - Apply widespread warning-cleanup fixes (explicit casts, type-safety, formatting/printf fixes, safer parsing) across
src/,include/,hal/, andtest/. - Add Unity output configuration for the test harness.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unity_config.h | Adds Unity output hook declarations/macros for native tests. |
| test/unity_config.cpp | Implements Unity output hooks and weak Unity fixtures for native runs. |
| test/test_vertical_velocity_estimator/test_vve_csv.h | Adds explicit casts to satisfy conversion/format warnings. |
| test/test_telemetry_data_transmission/test_telemetry_data_transmission.cpp | Removes leaks, improves formatting safety, fixes signed/unsigned loop issues. |
| test/test_state_machine/test_state_machine_csv.cpp | Fixes time difference computation to avoid narrowing/conversion warnings. |
| test/test_state_machine/main.cpp | Fixes float literals/casts and plugs heap leaks in tests. |
| test/test_launch_predictor/test_launch_predictor.cpp | Tightens types/literals and reduces implicit conversions. |
| test/test_ground_level_estimator/main.cpp | Fixes implicit int→float conversion in loop math. |
| test/test_fast_launch_detector/test_fast_launch_detector.cpp | Fixes literal types (U suffix / f suffix) to avoid conversions. |
| test/test_datasaver_spi/test_DataSaverSPI.cpp | Fixes literal types, loop types, and main signature. |
| test/test_circular_array/test_circular_array.h | Avoids implicit narrowing when indexing with uint8_t. |
| test/test_burnout_state_machine/test_burnout_state_machine_csv.cpp | Removes unused variable to satisfy warnings. |
| test/test_apogee_predictor_sim/main.cpp | Refactors parsing/helpers and adds safer numeric handling. |
| test/test_apogee_detector/test_apogee_detector_csv.cpp | Fixes time difference computation to avoid narrowing/conversion warnings. |
| test/SimpleSimulation.cpp | Fixes implicit integer division/conversion for timestep calculation. |
| test/CSVMockData.h | Tightens timestamp types and adds range checking. |
| test/AirResistanceSimulation.cpp | Fixes implicit integer division/conversion for timestep calculation. |
| src/state_estimation/VerticalVelocityEstimator.cpp | Makes axis indexing/casts explicit to satisfy stricter warnings. |
| src/state_estimation/StateMachine.cpp | Reorders initialization and removes unused locals under stricter warnings. |
| src/state_estimation/LaunchDetector.cpp | Tightens constructor/init math and time-diff bounds types. |
| src/state_estimation/BurnoutStateMachine.cpp | Reorders initialization and removes unused locals under stricter warnings. |
| src/state_estimation/ApogeePredictor.cpp | Fixes float literal suffixes to avoid double-promotion/conversion warnings. |
| src/data_handling/Telemetry.cpp | Tightens time types and loop index types for warnings-as-errors. |
| src/data_handling/SensorDataHandler.cpp | Adjusts ctor signature/init order to satisfy shadow/reorder warnings. |
| src/data_handling/DataSaverSPI.cpp | Tightens types/casts for timeouts, loops, and flash address math. |
| src/data_handling/DataSaverBigSD.cpp | Fixes millis() casts and snprintf float formatting. |
| src/UARTCommandHandler.cpp | Fixes millis() cast for warnings-as-errors. |
| platformio.ini | Enables aggressive warnings, -Werror, sanitizers, and improves check_flags formatting. |
| include/data_handling/Telemetry.h | Tightens hzToPeriod_ms return type conversion. |
| include/data_handling/DataSaver.h | Adds virtual destructor and silences unused-parameter warning in default hook. |
| include/data_handling/DataPoint.h | Applies _in parameter naming and keeps ctor warning-clean. |
| include/data_handling/CircularArray.h | Refactors indices to size_t and tightens arithmetic to satisfy conversions. |
| hal/serial_mock.h | Silences unused parameters and fixes signed/char comparisons in read helpers. |
| hal/DataSaver_mock.h | Makes assertion helper terminate reliably when expectation isn’t met. |
| hal/ArduinoHAL.h | Silences unused params and makes millis() return warning-clean/safe. |
| AGENTS.md | Documents _in naming rule and adds a couple of workflow notes. |
| .clang-tidy | Disables cppcoreguidelines-init-variables to match repo expectations. |
…t the start of the chat
…s not a duration of time
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.
Description
Adds multiple warning arguments and linters to ensure higher code quality
Summary of Changes
Motivation
Testing
Check all that apply:
Checklist