forked from pret/pokeplatinum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pret#176 from lhearachel/clang-format
Integrate clang-format
- Loading branch information
Showing
2,678 changed files
with
135,123 additions
and
133,833 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 |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
BasedOnStyle: WebKit | ||
Language: Cpp | ||
LineEnding: LF | ||
ColumnLimit: 0 | ||
|
||
AlignAfterOpenBracket: DontAlign | ||
AlignConsecutiveAssignments: None | ||
AlignConsecutiveBitFields: None | ||
AlignConsecutiveDeclarations: None | ||
AlignConsecutiveMacros: Consecutive | ||
AlignTrailingComments: false | ||
|
||
AllowShortBlocksOnASingleLine: Empty | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortEnumsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: None | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortLoopsOnASingleLine: false | ||
|
||
BinPackArguments: false | ||
BinPackParameters: false | ||
BitFieldColonSpacing: Both | ||
|
||
InsertBraces: true | ||
BreakBeforeBraces: Custom | ||
BraceWrapping: | ||
AfterCaseLabel: false | ||
AfterClass: false | ||
AfterControlStatement: Never | ||
AfterEnum: false | ||
AfterFunction: true | ||
AfterStruct: false | ||
AfterUnion: false | ||
BeforeElse: false | ||
BeforeWhile: false | ||
IndentBraces: false | ||
SplitEmptyFunction: true | ||
SplitEmptyRecord: false | ||
|
||
AlwaysBreakAfterReturnType: None | ||
BreakBeforeBinaryOperators: All | ||
BreakBeforeTernaryOperators: true | ||
BreakStringLiterals: true | ||
|
||
DerivePointerAlignment: false | ||
PointerAlignment: Right | ||
ReferenceAlignment: Right | ||
|
||
ContinuationIndentWidth: 4 | ||
IndentCaseBlocks: false | ||
IndentCaseLabels: false | ||
IndentGotoLabels: false | ||
IndentPPDirectives: None | ||
IndentWidth: 4 | ||
|
||
SortIncludes: CaseSensitive | ||
IncludeBlocks: Regroup | ||
IncludeCategories: | ||
- Regex: '((<.+>)|("nitro/.*\.h"))' | ||
Priority: 1 | ||
- Regex: '"(consts|constants)/.*\.h"' | ||
Priority: 2 | ||
- Regex: '"(struct_(decls|defs))/.*\.h"' | ||
Priority: 3 | ||
- Regex: '"(constdata|res)/.*\.(h|naix)"' | ||
Priority: 6 | ||
- Regex: '"[[:alnum:]_]+/.*\.(h|naix)"' | ||
Priority: 4 | ||
- Regex: '"[[:alnum:]_]+\.(h|naix)"' | ||
Priority: 5 | ||
- Regex: '.*' | ||
Priority: 7 | ||
|
||
InsertTrailingCommas: Wrapped | ||
InsertNewlineAtEOF: true | ||
KeepEmptyLinesAtEOF: false | ||
MaxEmptyLinesToKeep: 1 | ||
RemoveParentheses: ReturnStatement | ||
RemoveSemicolon: true | ||
|
||
# QualifierAlignment: Custom | ||
# QualifierOrder: [static, inline, const, volatile, type] | ||
|
||
SpaceAfterCStyleCast: false | ||
SpaceAfterLogicalNot: false | ||
SpaceAroundPointerQualifiers: Default | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCaseColon: false | ||
SpaceBeforeParens: ControlStatements | ||
SpaceBeforeSquareBrackets: false | ||
SpaceInEmptyBlock: false | ||
SpaceInEmptyParentheses: false | ||
SpacesInContainerLiterals: true | ||
SpacesInLineCommentPrefix: | ||
Minimum: 1 | ||
Maximum: -1 | ||
SpacesInParens: Never |
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,23 @@ | ||
# These files still contain inline-ASM functions; ignore them for formatting for now | ||
src/overlay117/ov117_02260668.c | ||
src/overlay112/ov112_0225C700.c | ||
src/overlay110/ov110_021D0D80.c | ||
src/overlay020/ov20_021D4728.c | ||
src/unk_0208A3F4.c | ||
src/unk_02089604.c | ||
src/overlay073/ov73_021D3250.c | ||
src/overlay107/ov107_02245EB0.c | ||
src/overlay107/ov107_02241AE0.c | ||
src/overlay007/ov7_02249960.c | ||
src/overlay071/ov71_0223C69C.c | ||
src/overlay019/ov19_021D0D80.c | ||
src/overlay022/ov22_02259C58.c | ||
src/overlay023/ov23_02253598.c | ||
src/overlay065/ov65_0222DCE0.c | ||
src/overlay064/ov64_0222DCE0.c | ||
src/overlay098/ov98_022471C8.c | ||
src/overlay062/ov62_02241204.c | ||
src/overlay062/ov62_0223DFA8.c | ||
src/overlay062/ov62_0223CAEC.c | ||
src/overlay062/ov62_02231690.c | ||
src/overlay062/ov62_02237D24.c |
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,3 @@ | ||
include/**/* | ||
src/**/* | ||
|
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,9 @@ | ||
#!/bin/sh | ||
# Redirect output to stderr. | ||
exec 1>&2 | ||
|
||
# Run clang-format on staged files; abort the commit if any files are changed | ||
if ! git clang-format ; then | ||
echo "linting made changes to source files; aborting commit" | ||
exit 1 | ||
fi |
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,32 @@ | ||
name: pr-lint | ||
on: | ||
pull_request: | ||
branches: [main] | ||
paths: ['**.c', '**.h'] | ||
|
||
jobs: | ||
pr-lint: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: cpp-linter/cpp-linter-action@v2 | ||
id: linter | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
style: 'file' # Use repository .clang-format file | ||
tidy-checks: '-*' # Disable clang-tidy checks | ||
version: '18' | ||
files-changed-only: false # Github returns error code 406 if more than 300 files are changed in a PR | ||
ignore: '.github|lib|subprojects|tools' | ||
file-annotations: false | ||
|
||
- name: fail fast | ||
if: steps.linter.outputs.clang-format-checks-failed > 0 | ||
run: exit 1 |
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,4 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
"${NINJA:-ninja}" -C build clang-format |
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
Oops, something went wrong.