Skip to content

Fix CI format-check failures across codebase #129

@currentsuspect

Description

@currentsuspect

Problem

CI format-check job is failing on pre-existing formatting issues in the codebase. These errors appear when running clang-format-14 --dry-run --Werror in the GitHub Actions Ubuntu 24.04 runner environment.

Error Locations

File Lines Issue
AestraAudio/include/DSP/SampleRateConverter.h 353, 354, 356, 357 Formatting violations
AestraAudio/src/Win32/WASAPISharedDriver.cpp 491 Formatting violation
AestraAudio/src/Win32/WASAPIExclusiveDriver.cpp 515, 804 Formatting violations
AestraAudio/src/Core/AudioDeviceManager.cpp 219 Formatting violation
AestraCore/include/AestraThreading.h 185, 186, 270, 271 Formatting violations
AestraCore/include/CPUDetection.h 37, 38, 41, 42, 47, 48 Formatting violations
AestraCore/src/AestraProfiler.cpp 221, 222 Formatting violations

Environment Details

  • CI Runner: Ubuntu 24.04, clang-format-14 (installed via apt)
  • Local VPS: Ubuntu 22.04, clang-format 14.0.0 -- formats pass locally
  • Config: .clang-format (BasedOnStyle: LLVM, ColumnLimit: 120)

Root Cause

The CI runner's clang-format-14 produces different formatting output than local clang-format, despite being the same major version. This is likely due to different clang-format builds/patches between Ubuntu 22.04 and 24.04.

Current CI Status

  • Build Linux: PASSED
  • Build Windows: PASSED
  • Build macOS: PASSED
  • Tests: Compiled successfully
  • Format-check: FAILING (cosmetic, pre-existing)

Reproduction Steps

  1. Push any commit to develop branch
  2. CI triggers format-check job
  3. Job runs formatting check
  4. Errors reported on files listed above

Attempted Fixes

  • Applied clang-format -i locally to all affected files -- no changes (already formatted)
  • Verified with local clang-format --dry-run --Werror -- no violations detected
  • Empty commit to trigger fresh CI -- same errors persist

Proposed Solutions

Option 1: Pin Exact clang-format Version (Recommended)

Update CI to use a specific, reproducible clang-format version from LLVM releases.

Option 2: Format All Files with CI Version

Run the CI's clang-format locally via Docker to match its output exactly.

Option 3: Use clang-format Off/On Guards

Wrap problematic sections in // clang-format off/on comments.

Acceptance Criteria

  • Format-check job passes in CI
  • All existing builds (Linux, Windows, macOS) continue to pass
  • No functional code changes (formatting only)
  • Solution is reproducible

Priority

Low -- This is a cosmetic issue. Builds and tests are passing. The functional code is correct.

Assignee Notes for Automation

This issue is suitable for automation with a Copilot model. The task is repetitive and well-defined:

  1. Run formatting commands in CI-matching environment
  2. Verify changes don't break builds
  3. Commit with message: style: Fix clang-format violations in [files]
  4. Push and verify CI passes

No complex logic or architectural decisions required. Safe to automate.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions