-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
179 changed files
with
7,366 additions
and
7,504 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,13 @@ | ||
--- | ||
BasedOnStyle: Google | ||
IndentWidth: 4 | ||
Language: Cpp | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: Inline | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
PointerAlignment: Left | ||
ColumnLimit: 80 | ||
AccessModifierOffset: 0 | ||
KeepEmptyLinesAtTheStartOfBlocks: true |
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,46 @@ | ||
#!/bin/bash | ||
# | ||
# check that all code complies w/ the clang-format specification | ||
# | ||
# if all is well, returns w/o errors and does not print anything. | ||
# otherwise, return an error and print offending changes | ||
|
||
set -e # abort on error | ||
|
||
INCLUDE_DIRS=("apps core display plugins tests") | ||
|
||
if [ $# -ne 1 ]; then | ||
echo "wrong number of arguments" | ||
echo "" | ||
echo "usage: check_format <DIR>" | ||
exit 1 | ||
fi | ||
|
||
_binary=${CLANG_FORMAT_BINARY:-clang-format} | ||
|
||
$_binary --version | ||
|
||
cd $1 | ||
$_binary -i -style=file $(find ${INCLUDE_DIRS} \( -iname '*.cpp' -or -iname '*.hpp' -or -iname '*.ipp' -or -iname '*.inl' -or -iname '*.cu' -or -iname '*.cuh' -or -iname '*.hip' -or -iname '*.sycl' \)) | ||
|
||
if ! [ -z $CI ] || ! [ -z $GITHUB_ACTIONS ]; then | ||
mkdir changed | ||
for f in $(git diff --name-only -- ${INCLUDE_DIRS[@]/#/:/}); do | ||
cp --parents $f changed | ||
done | ||
fi | ||
|
||
echo "clang-format done" | ||
|
||
set +e | ||
git diff --exit-code --stat -- ${INCLUDE_DIRS[@]/#/:/} | ||
result=$? | ||
|
||
if [ "$result" -eq "128" ]; then | ||
echo "Format was successfully applied" | ||
echo "Could not create summary of affected files" | ||
echo "Are you in a submodule?" | ||
|
||
fi | ||
|
||
exit $result |
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
branches: | ||
- main | ||
- 'release/**' | ||
|
||
jobs: | ||
ubuntu: | ||
runs-on: ubuntu-latest | ||
|
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,21 @@ | ||
name: Checks | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/acts-project/format10:v11 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Check | ||
run: .github/check_format.sh . | ||
- uses: actions/upload-artifact@v1 | ||
if: failure() | ||
with: | ||
name: changed | ||
path: changed |
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.