On 06/08/2015 09:22 AM, Daniel Schürmann wrote:
Hi,
I have some good experience with the Eclipse Formatter:
http://www.mixxx.org/wiki/doku.php/eclipse?s[]=eclipse#eclipse_code_formatter
We have to be careful not to put clutter on a PR just because using an auto
formatter.
This may happens if an auto formatter changes code that already meets the
requirements.
Then we need to adjust the auto formatter rules ;). I fixed some more
things in the format file (Seems like we differ quite a lot from the
google style actually)
Therefor I prefer the way Eclipse works, It supports you as much as
possible while
editing. It does not reformat the code except you ask for it "Ctrl-Shift-F"
Emacs is also able to do this. It is just a matter of what people
prefer. I assume other IDE's can also do that.
I just thought this is a nice way for people to automatically have there
coding styles fixed without having to setup their IDE completely for
mixxx. I think saying "run `clang-format -i <files-you-edited>`" once in
a PR might be nicer then all the nit-pick comments we are doing now.
What may help, In the Mixxx project is a build chain tool that warns about
code style violations.
Would be nice. Then we would get all the warning where we still violate
our own style.
Kind regards,
Daniel
2015-06-07 11:54 GMT+02:00 Max Linke <max_li...@gmx.de>:
There is really no way to port this. It is the configuration file for
`clang-format` a separate program. Since I only use emacs I don't know how
to best use it in other editors.
you can find more information here
http://clang.llvm.org/docs/ClangFormat.html
Just try to google clang-format + your favorite editor
ecplise: https://github.com/wangzw/cppstyle
sublime: https://github.com/rosshemsley/SublimeClangFormat
creator:
https://www.snip2code.com/Snippet/11436/Configuration-of-clang-format-for-QtCrea
You can also always use it from the CLI
clang-format -i [file1 ... ]
I missed some indentation settings in the yesterday. Attached is an
updated file.
best Max
On 06/07/2015 11:18 AM, Tuukka Pasanen wrote:
Hello,
Can you port this to astyle because not everyone are using Emacs or
something silmilar for more convient use.
Thanks,
Tuukka
2015-06-06 21:43 GMT+03:00 Max Linke <max_li...@gmx.de>:
Hi
We had some recurring discussions in the PR about coding style. I have
recently started to rely on clang-format with a set of predefined rules.
My
emacs is configured to apply this always before I save a file. I
personally
find that really nice and relaxing, I don't need to format my code
manually
anymore and every time I touch a file it automatically looks nice.
I attached the clang-format file I use for mixxx. It is based on the
Google
style with our indentation rules.
This would also help in a PR because we can just point them to
clang-format.
I don't have experience with other editors besides emacs but I guess it
should be also possible in a something like vim or eclipse.
What do you think? Would others like to use this as well?
best Max
------------------------------------------------------------------------------
_______________________________________________
Get Mixxx, the #1 Free MP3 DJ Mixing software Today
http://mixxx.org
Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel
------------------------------------------------------------------------------
_______________________________________________
Get Mixxx, the #1 Free MP3 DJ Mixing software Today
http://mixxx.org
Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel
------------------------------------------------------------------------------
_______________________________________________
Get Mixxx, the #1 Free MP3 DJ Mixing software Today
http://mixxx.org
Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -2
AlignAfterOpenBracket: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: true
BinPackArguments: true
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 8
DerivePointerAlignment: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
IndentWrappedFunctionNames: false
IndentFunctionDeclarationAfterType: false
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: false
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
SpacesBeforeTrailingComments: 1
Cpp11BracedListStyle: true
Standard: Auto
IndentWidth: 4
TabWidth: 4
UseTab: Never
BreakBeforeBraces: Attach
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterCStyleCast: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 8
CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
SpaceBeforeParens: ControlStatements
DisableFormat: false
...
------------------------------------------------------------------------------
_______________________________________________
Get Mixxx, the #1 Free MP3 DJ Mixing software Today
http://mixxx.org
Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel