Files
mayhem-firmware/format-code.ps1
T
gullradriel 95eafeb812 fix clang format workflow, update hackrf submodule, fix subghzd compilation warning, remove flashsize.h (#2992)
* trying to fix clang format workflow
* try without docker repo, classic apt install
* find what installed clang format 18 version is
* removed auto generated flashsize
* comment on flashsize.h
* modified to use repo owned clang-format binaries
* code format for windows hosts
* add clang-format binaries for linux x86_64/arm64, macos-arm64, windows x86_64
* add helper script to download specific llvm clang-format version
* add helper to download missing libraries (use docker)
* use custom clang-format
* fix ui_subghzd.cpp:85:29: warning: narrowing conversion of 'this->ui::SubGhzDRecentEntryDetailView::cnt' from 'uint32_t' {aka 'long unsigned int'} to 'uint16_t' {aka 'short unsigned int'} [-Wnarrowing]
* remove auto generated file
* Update tools/clang-format.sh
* removed fallback
* updated hackrf submodule
2026-02-15 21:29:26 +00:00

38 lines
960 B
PowerShell

$ErrorActionPreference = "Stop"
# Run from repo root (script is in repo root)
$CF = Join-Path $PSScriptRoot "tools\clang-format.ps1"
if (-not (Test-Path $CF)) {
throw "ERROR: $CF not found. Did you commit tools\clang-format.ps1 and the pinned binaries?"
}
# Print version for traceability
& $CF --version | Write-Host
# Collect files (PowerShell-native; avoids xargs/find differences on Windows)
$roots = @(
"firmware/common",
"firmware/baseband",
"firmware/application",
"firmware/test/application",
"firmware/test/baseband"
)
$files = foreach ($r in $roots) {
if (Test-Path $r) {
Get-ChildItem -Path $r -Recurse -File -ErrorAction SilentlyContinue |
Where-Object { $_.Extension -in @(".h", ".hpp", ".c", ".cpp") } |
ForEach-Object { $_.FullName }
}
}
if (-not $files -or $files.Count -eq 0) {
Write-Host "No matching source files found."
exit 0
}
# Format in place
& $CF -style=file -i -- $files
exit $LASTEXITCODE