mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Add clang-format file
People should run `make format` before doing a commit. Fix https://github.com/profanity-im/profanity/issues/1396
This commit is contained in:
parent
87ddb8081e
commit
66f9a6b721
33
.clang-format
Normal file
33
.clang-format
Normal file
@ -0,0 +1,33 @@
|
||||
Language: Cpp
|
||||
BasedOnStyle: GNU
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeSquareBrackets: false
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
ColumnLimit: 0
|
||||
PointerAlignment: Left
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveMacros: true
|
||||
AlignEscapedNewlines: Left
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: true
|
||||
IndentWidth: 4
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: true
|
||||
AfterControlStatement: Never
|
||||
AfterFunction: true
|
||||
BeforeElse: false
|
||||
#BeforeWhile: false
|
||||
AfterStruct: true
|
||||
#BreakStringLiterals: true
|
@ -3,6 +3,11 @@
|
||||
## Coding style
|
||||
Follow the style already present ;-)
|
||||
|
||||
To make this easier for you we created a `.clang-format` file.
|
||||
You'll need to have `clang-format` installed.
|
||||
|
||||
Then just run `make format` before you do any commit.
|
||||
|
||||
## Pull Requests
|
||||
Before submitting a Pull Request please run valgrind and the clang static code analyzer.
|
||||
|
||||
|
10
Makefile.am
10
Makefile.am
@ -237,6 +237,13 @@ core_sources += $(omemo_sources)
|
||||
unittest_sources += $(omemo_unittest_sources)
|
||||
endif
|
||||
|
||||
all_c_sources = $(core_sources) $(unittest_sources) \
|
||||
$(pgp_sources) $(pgp_unittest_sources) \
|
||||
$(otr3_sources) $(otr4_sources) $(otr_unittest_sources) \
|
||||
$(omemo_sources) $(omemo_unittest_sources) \
|
||||
$(c_sources) $(python_sources) \
|
||||
$(main_source)
|
||||
|
||||
AM_CFLAGS = @AM_CFLAGS@ -I$(srcdir)/src
|
||||
|
||||
bin_PROGRAMS = profanity
|
||||
@ -324,3 +331,6 @@ endif
|
||||
|
||||
check-unit: tests/unittests/unittests
|
||||
tests/unittests/unittests
|
||||
|
||||
format: $(all_c_sources)
|
||||
clang-format -i $(all_c_sources)
|
||||
|
Loading…
Reference in New Issue
Block a user