Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for clang-format #428

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# 1
IndentWidth: 4
TabWidth: 4
UseTab: Never
IndentPPDirectives: AfterHash # Unknown to clang-format-5.0
PPIndentWidth: 1
AccessModifierOffset: -4

# 2
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
ColumnLimit: 80
BreakStringLiterals: false
AlignAfterOpenBracket: Align
BinPackArguments: false
BinPackParameters: true
InsertTrailingCommas: Wrapped
ExperimentalAutoDetectBinPacking: false
AllowAllParametersOfDeclarationOnNextLine: true
ContinuationIndentWidth: 4

# 3
BreakBeforeBraces: Linux
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: false
IndentCaseBlocks: false
IndentCaseLabels: false
Cpp11BracedListStyle: false

# 3.1
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterFunctionDefinitionName: false
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
AlignArrayOfStructures: None
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Left # Unknown to clang-format-4.0
AlignOperands: Align
BreakBeforeBinaryOperators: NonAssignment
AlignTrailingComments: true

# 7
PointerAlignment: Right
DerivePointerAlignment: false

# 14
Standard: Cpp03

# unsorted

AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BreakBeforeTernaryOperators: true
DisableFormat: false
#FixNamespaceComments: false # Unknown to clang-format-4.0

IncludeBlocks: Regroup # Unknown to clang-format-5.0
IndentWrappedFunctionNames: false
MacroBlockBegin: ''
MacroBlockEnd: ''
NamespaceIndentation: None
#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true

#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 10
PenaltyExcessCharacter: 100
PenaltyReturnTypeOnItsOwnLine: 60

ReflowComments: false
SeparateDefinitionBlocks: Always
SortIncludes: CaseInsensitive
#SortUsingDeclarations: false # Unknown to clang-format-4.0

Cpp11BracedListStyle: true # bad but reduces initial diff
IndentExternBlock: NoIndent
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cf83bf3cb9108370bef19284278152e14acb115a
390d81c8b7247afe28c4316174d6fba2d617f25b
9 changes: 9 additions & 0 deletions .github/format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -efux

PREFIX=$HOME/opt
PATH=$PREFIX/bin:$PATH

list=$(git ls-tree --name-only -r HEAD | grep -v ecp_id_.* | grep -v gost_grasshopper_precompiled.c | grep '[.][ch]$')
clang-format -i $list
diffLen=$(git diff | wc -l)
test 0 -eq $diffLen || exit 1
93 changes: 4 additions & 89 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,96 +6,11 @@ env:
USE_RPATH: yes

jobs:
gcc-openssl-stable:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: .github/before_script.sh
- run: .github/script.sh

clang-openssl-stable:
runs-on: ubuntu-20.04
env:
CC: clang
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: .github/before_script.sh
- run: .github/script.sh

macos-openssl-stable:
runs-on: macos-11
env:
USE_RPATH:
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: .github/before_script.sh
- run: .github/script.sh

gcc-openssl-master:
runs-on: ubuntu-20.04
env:
OPENSSL_BRANCH: master
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: .github/before_script.sh
- run: .github/script.sh

macos-openssl-master:
runs-on: macos-11
env:
OPENSSL_BRANCH: master
USE_RPATH:
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: .github/before_script.sh
- run: .github/script.sh

gcc-asan-openssl-master:
runs-on: ubuntu-20.04
env:
OPENSSL_BRANCH: master
ASAN: -DASAN=1
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: .github/before_script.sh
- run: .github/script.sh

macos-asan-openssl-master:
runs-on: macos-latest
env:
OPENSSL_BRANCH: master
ASAN: -DASAN=1
USE_RPATH:
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: .github/before_script.sh
- run: .github/script.sh

gcc-openssl-stable-x86:
runs-on: ubuntu-20.04
clang-format:
runs-on: ubuntu-22.04
env:
CFLAGS: -m32
LDFLAGS: -m32
SETARCH: "setarch i386"
APT_INSTALL: gcc-multilib
APT_INSTALL: clang-format
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: .github/before_script.sh
- run: .github/script.sh
- run: .github/format.sh

Loading