Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
Add clang-format config file
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Dec 18, 2017
1 parent 0bfab57 commit d54bcbb
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 4 deletions.
94 changes: 94 additions & 0 deletions .clang-format
@@ -0,0 +1,94 @@
---
Language: Cpp
# BasedOnStyle: Chromium
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: BeforeColon
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^".*'
Priority: 1
- Regex: '^<boost.*'
Priority: 98
- Regex: '^<.*\.h>'
Priority: 2
- Regex: '^<.*'
Priority: 99
- Regex: '.*'
Priority: 4
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 1
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 50
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 4
UseTab: Never
...
19 changes: 15 additions & 4 deletions CONTRIBUTING.md
@@ -1,5 +1,16 @@
# cpp-ethereum Contributing and Reviews Guidelines
# cpp-ethereum Contributing and Review Guidelines

1. All submitted Pull Requests are assumed to be ready for review
unless they are labeled with `[in progress]`
or have "[WIP]" in title.
1. All submitted **Pull Requests** are assumed to be ready for review
unless they are labeled with `[in progress]` or have "[WIP]" in title.

2. **Code formatting** rules are described by the [Clang-Format Style Options] file [.clang-format].
Please use the [clang-format] tool to format your code _changes_ accordingly.

Example:

clang-format -i -lines=146:159 libevm/JitVM.cpp


[Clang-Format Style Options]: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
[clang-format]: https://clang.llvm.org/docs/ClangFormat.html
[.clang-format]: .clang-format

0 comments on commit d54bcbb

Please sign in to comment.