-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* clang formatting changes * remove custom clang script * try different clang runner * fix runner * add intentional clang break * fix one clang - add another for additional test * go to zero local clang format issues
- Loading branch information
1 parent
651ec19
commit efde18f
Showing
11 changed files
with
29 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,18 +10,18 @@ permissions: | |
|
||
jobs: | ||
check-formatting: | ||
runs-on: windows-latest | ||
|
||
name: Formatting Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | ||
with: | ||
egress-policy: audit | ||
|
||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | ||
with: | ||
egress-policy: audit | ||
|
||
- name: clang-format (w/ diff) | ||
uses: egor-tensin/clang-format@5ee263e007725df60d02ef2e6fd3d0dd92f048a0 # v1.0.1 | ||
with: | ||
# :-separated list of excluded files and directories | ||
exclude: include:mapistub | ||
- uses: actions/checkout@v4 | ||
- name: Run clang-format style check for C/C++ programs. | ||
uses: jidicula/[email protected] | ||
with: | ||
clang-format-version: '17' | ||
exclude-regex: 'mapistub/*' | ||
fallback-style: 'Microsoft' |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
$vsRoot = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath | ||
$vcInstallDir = Join-Path $vsRoot "VC" | ||
$clangdir = Join-Path $vcInstallDir "Tools\Llvm\bin\clang-format.exe" | ||
$clang = Join-Path $vcInstallDir "Tools\Llvm\bin\clang-format.exe" | ||
|
||
# Check if VC install directory was found | ||
if ($null -eq $vcInstallDir) { | ||
Write-Host "Visual C++ installation directory not found." | ||
} | ||
|
||
if ($null -eq $clangdir) { | ||
if ($null -eq $clang) { | ||
Write-Host "clang not found." | ||
} | ||
Write-Host "clang-format found at $clang" | ||
& $clang --version | ||
|
||
Push-Location .. | ||
|
||
Write-Host "Formatting C++ headers" | ||
Get-ChildItem -Recurse -Filter *.h | Where-Object { $_.DirectoryName -notlike "*include*" } | ForEach-Object { | ||
& $clangdir -i $_.FullName | ||
& $clang -i $_.FullName | ||
} | ||
|
||
Write-Host "Formatting C++ sources" | ||
Get-ChildItem -Recurse -Filter *.cpp | ForEach-Object { | ||
& $clangdir -i $_.FullName | ||
& $clang -i $_.FullName | ||
} | ||
|
||
Pop-Location |