-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
195 additions
and
279 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 |
---|---|---|
@@ -1,13 +1,24 @@ | ||
--- | ||
BasedOnStyle: Microsoft | ||
DisableFormat: true | ||
--- | ||
Language: Cpp | ||
BasedOnStyle: Microsoft | ||
|
||
AccessModifierOffset: -4 | ||
AllowAllArgumentsOnNextLine: false | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AlwaysBreakTemplateDeclarations: Yes | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BreakAfterAttributes: Always | ||
BreakBeforeBraces: Allman | ||
BreakConstructorInitializers: BeforeComma | ||
BreakInheritanceList: BeforeComma | ||
InsertNewlineAtEOF: true | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
PointerAlignment: Left | ||
SpaceAfterTemplateKeyword: false | ||
|
||
IntegerLiteralSeparator: | ||
Binary: 4 | ||
BinaryMinDigits: 4 |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Format Workflow (C++) | ||
|
||
on: | ||
push: | ||
branches: '**' | ||
paths: | ||
- .github/workflows/cpp-format.yml | ||
|
||
- '**.hpp' | ||
- '**.cpp' | ||
- .clang-format | ||
|
||
pull_request: | ||
paths: | ||
- .github/workflows/cpp-format.yml | ||
|
||
- '**.hpp' | ||
- '**.cpp' | ||
- .clang-format | ||
|
||
env: | ||
LLVM_VERSION: 18 | ||
|
||
jobs: | ||
format: | ||
name: Check the formatting | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Pin to a specific version | ||
run: | | ||
$latestChocoVersion = (Resolve-ChocoPackageVersion -TargetVersion ${env:LLVM_VERSION} -PackageName 'llvm') | ||
Install-ChocoPackage -PackageName llvm -ArgumentList '--allow-downgrade', '--version', ${latestChocoVersion} | ||
- name: Determine BASE commit (push) | ||
if: github.event_name == 'push' | ||
env: | ||
GIT_COMMIT_SHA: ${{ github.event.before }} | ||
GIT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} | ||
run: | | ||
$commitSha = ${env:GIT_COMMIT_SHA} | ||
if (${commitSha} -match "^0+$") { | ||
Write-Host "'before' is all zeros. This is likely a new branch. Finding a common ancestor with the default branch." | ||
$defaultBranch = ${env:GIT_DEFAULT_BRANCH} | ||
$commitSha = (git merge-base --fork-point "remotes/origin/${defaultBranch}") | ||
if ([string]::IsNullOrEmpty(${commitSha})) { | ||
Write-Host "No common ancestor found, using the first commit in the repository." | ||
$commitSha = (git rev-list --max-parents=0 --reverse HEAD | Select-Object -First 1) | ||
} | ||
} | ||
Add-Content -LiteralPath ${env:GITHUB_ENV} -Encoding UTF8 -Value "RED3EXT_COMMIT_BEFORE=${commitSha}" | ||
exit 0 | ||
- name: Determine BASE commit (pull request) | ||
if: github.event_name == 'pull_request' | ||
env: | ||
GIT_COMMIT_SHA: ${{ github.event.pull_request.base.sha }} | ||
run: | | ||
Add-Content -LiteralPath ${env:GITHUB_ENV} -Encoding UTF8 -Value "RED3EXT_COMMIT_BEFORE=${env:GIT_COMMIT_SHA}" | ||
- name: Determine HEAD commit | ||
env: | ||
GIT_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | ||
run: | | ||
Add-Content -LiteralPath ${env:GITHUB_ENV} -Encoding UTF8 -Value "RED3EXT_COMMIT_AFTER=${env:GIT_COMMIT_SHA}" | ||
- name: Run clang-format | ||
run: | | ||
git ` | ||
-c core.autocrlf=false ` | ||
-c core.eol=lf ` | ||
-c color.ui=always ` | ||
clang-format ` | ||
--style file ` | ||
--diff ${env:RED3EXT_COMMIT_BEFORE} ${env:RED3EXT_COMMIT_AFTER} |
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,3 +1 @@ | ||
build/ | ||
|
||
src/ported/Version.hpp |
Oops, something went wrong.