diff options
| author | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2021-08-28 17:17:17 +0300 |
|---|---|---|
| committer | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2021-08-29 20:30:29 +0300 |
| commit | 7d17b324addc5f2dafd18a494834a39ecb1c33bb (patch) | |
| tree | 2769d052fa4f1a45211979b0d59a19b3d79bfc6a | |
| parent | 035977a89ae04d99892b3382582ec5b0b8b6a140 (diff) | |
build: update coding-style settings
Update .editorconfig, and add .clang-format.
Note that current code does _not_ follow that, but we'll slowly get there.
| -rw-r--r-- | .clang-format | 39 | ||||
| -rw-r--r-- | .editorconfig | 12 |
2 files changed, 44 insertions, 7 deletions
diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..621eb83 --- /dev/null +++ b/.clang-format @@ -0,0 +1,39 @@ +--- +AlignAfterOpenBracket: 'Align' +AlignConsecutiveAssignments: 'false' +AlignConsecutiveDeclarations: 'false' +AlignConsecutiveMacros: 'true' +AlignOperands: 'true' +AlignTrailingComments: 'true' +AllowAllArgumentsOnNextLine: 'false' +AllowAllParametersOfDeclarationOnNextLine: 'false' +AllowShortBlocksOnASingleLine: 'false' +AllowShortCaseLabelsOnASingleLine: 'false' +AllowShortFunctionsOnASingleLine: 'Inline' +AllowShortIfStatementsOnASingleLine: 'false' +AlwaysBreakAfterReturnType: 'All' +BinPackParameters: 'false' +BinPackArguments: 'false' +BreakBeforeBraces: 'Linux' +ColumnLimit: '100' +DerivePointerAlignment: 'false' +IndentCaseLabels: 'false' +IndentWidth: '8' +KeepEmptyLinesAtTheStartOfBlocks: 'false' +Language: 'Cpp' +MaxEmptyLinesToKeep: '1' +PointerAlignment: 'Right' +SortIncludes: 'false' +SpaceAfterCStyleCast: 'false' +SpaceBeforeAssignmentOperators : 'true' +SpaceBeforeParens: 'ControlStatements' +SpaceInEmptyParentheses: 'false' +SpacesInSquareBrackets: 'false' +TabWidth: '8' +UseTab: 'AlignWithSpaces' +PenaltyBreakAssignment: '3' +PenaltyBreakBeforeFirstCallParameter: '15' + +# Local Variables: +# mode: yaml +# End: diff --git a/.editorconfig b/.editorconfig index d7b5d39..28ae07e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,6 +2,7 @@ # editorconfig file (see EditorConfig.org), with some # lowest-denominator settings that should work for many editors. + root = true # this is the top-level [*] @@ -10,23 +11,20 @@ insert_final_newline = true charset = utf-8 trim_trailing_whitespace = true -# The "best" answer is "tabs-for-indentation; spaces for alignment", but in -# practice that's hard to accomplish in many editors. -# -# So we use spaces instead, at least that looks consistent for all +# The "best" answer is "tabs-for-indentation; spaces for alignment". [*.{cc,cpp,hh,hpp}] -indent_style = space +indent_style = tab indent_size = 8 max_line_length = 100 [*.{c,h}] -indent_style = space +indent_style = tab indent_size = 8 max_line_length = 80 [configure.ac] -indent_style = space +indent_style = tab indent_size = 4 max_line_length = 100 |
