Skip to content
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
99 changes: 99 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# 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: true
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
PenaltyIndentedWhitespace: 3
11 changes: 11 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
297599693eb23e47377d65408bbafc64584da09f
12aeacd1571ef59dfa76e70cf78ac22d8c9e56bf
5a4f74d2148f0a36c364cf6aa2af4e9bc0492d3e
5a587fc4a072fa6a8ab819cb6071bd1c3d34b31d
ba47e42472bc5352dd73da24bc14e0f25cabc5dc
044f3597f1ce2e59047cfa1fcad5a7504292ecf4
a8a461e9f8cbef8808c18220921396e46def04b6
16ea890afa1622b757c3b148bfb8a91d4963a9b6
cf83bf3cb9108370bef19284278152e14acb115a
390d81c8b7247afe28c4316174d6fba2d617f25b
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это надо будет поменять, когда окончательная редакция первого патча будет


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 -v ^e_gost_err | grep '[.][ch]$')
clang-format -i $list
diffLen=$(git diff | wc -l)
test 0 -eq $diffLen || exit 1
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,11 @@ jobs:
- run: .github/before_script.sh
- run: .github/script.sh

clang-format:
runs-on: ubuntu-22.04
env:
APT_INSTALL: clang-format
steps:
- uses: actions/checkout@v2
- run: .github/format.sh

Loading