Hello, On 30/12/2015 00:17, [email protected] wrote:
On 2015-12-19 19:47, Sacha Delanoue wrote:http://clang.llvm.org/docs/ClangFormatStyleOptions.html :- AccessModifierOffset: I found both use of value 0 and -4 in Hydrogen;4 characters.
Unfortunately this option is not very clear. By 4 characters do you mean that code should be written like this:
class Foo {
<TAB>public:
<TAB><TAB>Foo();
};
If so, then so clang-format setting is 0
- AlignAfterOpenBracket: this case happens rarely, maybe with DontAlign;Is this for function calls or definitions/declarations? The description of the property says nothing about it (and how it works in combination with BinPackArguments and BinPackParameters.
I think it is for all brackets. Here it is the setting for the *indentation*. Whereas for BinPackArguments and BinPackParameters it is about line break.
- AlwaysBreakTemplateDeclarations: no templates are used in Hydrogen;
You did not reply to this, so I’m using “true” in the proposal because this is how I most frequently encountered it. This is of little importance since no one use templates for now, but if some day someone wants to, it will be ready.
- BreakBeforeBraces: inconsistent through Hydrogen;Yes, at the moment hydrogen uses breaks before braces after function definitions, but not after if statements.
Let’s use Mozilla then (“break before braces on enum, function, and record definitions”).
- ConstructorInitializerIndentWidthWe're using currently "1" a lot, if i'm not mistaken..
1 character ? Do you mean 4 like an indent width ?
Maybe we should start with those settings and see how this works out. It's sometimes hard to come to a decision without having good examples :) Could you create an example configuration file and send it to the list?
I’m joining this file to this mail. To use is, save it on this hydrogen folder, or any of its parent folder. See http://clang.llvm.org/docs/ClangFormat.html for how to run clang-format. Then you can run it on existing Hydrogen source code for instance to see how it would look (and git reset --hard HEAD after).
Note that I have commented out 4 lines because there are documented on clang-format-3.8, but are not on clang-format-3.6, which you would find on a lot of GNU/Linux distributions. And if uncommented on clang-format-3.6, it causes an error.
If someone has other opinions on the above mentioned settings, please speak up!
If find that these are nice choices, and coherent (as much as possible) with the existing code base. The only thing I could say is that I think that very long lines (120+ characters) should not exist, but the setting “ColumnLimit: 0” has some advantages on its own so I guess it’s OK.
Regards, -- Sacha “Shaac” Delanoue
# Hydrogen coding style (first proposal) AccessModifierOffset: 0 # not sure though # AlignAfterOpenBracket: DontAlign # ? # AlignConsecutiveAssignments: false # AlignConsecutiveDeclarations: false AlignEscapedNewlinesLeft: false AlignOperands: true AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: Inline AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false # AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: true AlwaysBreakTemplateDeclarations: true # don't know since there are no templates BinPackArguments: false # ? BinPackParameters: false # ? BreakBeforeBinaryOperators: false BreakBeforeBraces: Linux BreakBeforeTernaryOperators: false BreakConstructorInitializersBeforeComma: false ColumnLimit: 0 ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerIndentWidth: 4 # ? ContinuationIndentWidth: 8 # ? Cpp11BracedListStyle: false DerivePointerAlignment: false IndentCaseLabels: true IndentWidth: 4 IndentWrappedFunctionNames: true KeepEmptyLinesAtTheStartOfBlocks: false Language: Cpp MaxEmptyLinesToKeep: 2 NamespaceIndentation: None PointerAlignment: Right SpaceAfterCStyleCast: false SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false SpacesInCStyleCastParentheses: true SpacesInContainerLiterals: true SpacesInParentheses: true SpacesInSquareBrackets: true # but may look strange Standard: Cpp03 TabWidth: 4 UseTab: ForIndentation
------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________ Hydrogen-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hydrogen-devel
