Skip to content

Fix/wall#90

Merged
Elan456 merged 27 commits intomainfrom
fix/Wall
Mar 28, 2026
Merged

Fix/wall#90
Elan456 merged 27 commits intomainfrom
fix/Wall

Conversation

@Elan456
Copy link
Copy Markdown
Contributor

@Elan456 Elan456 commented Mar 27, 2026

Description

Adds multiple warning arguments and linters to ensure higher code quality

Summary of Changes

  • Adds multiple build arguments for sanitizers and warnings
  • Warnings are now treated as errors

Motivation

  • These warnings will catch and force you to think about what exactly you want the code to do. It prevents situations where ambiguous code causes bugs.
  • A lot of warning debt has been built up over time; this PR cleans out all the debt and allows us to start fresh.

Testing

Check all that apply:

  • I have added or modified unit tests to cover these changes.
  • I have manually tested the changes on the target device(s) or environment(s).
  • Existing tests were reviewed to ensure they still work as expected.
  • If tests were not added or modified, explain why:

    (Provide reasoning here)


Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code where necessary for clarity.
  • I have made corresponding updates to documentation (if applicable).

Copy link
Copy Markdown
Contributor

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 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.ini native 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/, and test/.
  • 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.

Copy link
Copy Markdown
Contributor

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

Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.

Copy link
Copy Markdown
Contributor

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

Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.

Copy link
Copy Markdown
Contributor

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

Copilot reviewed 38 out of 38 changed files in this pull request and generated 2 comments.

Copy link
Copy Markdown
Contributor

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

Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.

@Elan456 Elan456 merged commit 6374ceb into main Mar 28, 2026
7 checks passed
@Elan456 Elan456 deleted the fix/Wall branch March 28, 2026 22:53
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