diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000000000000000000000000000000000..99bf475e5cfd40d9a84d7e21d28b1f0380870114 --- /dev/null +++ b/.clang-format @@ -0,0 +1,116 @@ +--- +Language: Cpp +# BasedOnStyle: LLVM +AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Right +AlignOperands: true +AlignTrailingComments: false +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: true +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: true +BinPackParameters: true +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Custom +BraceWrapping: + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: true + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 120 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Merge +IncludeCategories: + - Regex: '^"' + Priority: 2 + - Regex: '^<' + Priority: 3 + - Regex: '.*' + Priority: 1 +IncludeIsMainRegex: '(Test)?$' +IndentCaseLabels: true +IndentPPDirectives: None +IndentWidth: 4 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Left +ReflowComments: true +SortIncludes: false +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Cpp11 +TabWidth: 4 +UseTab: ForIndentation +... + diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index f25060c0a0ccdd77d361f71cffaeeb85e993991b..684c966e49b30670fa8b7e5fc58997469b6e3ecc 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,7 +1,16 @@ <component name="ProjectCodeStyleConfiguration"> <code_scheme name="Project" version="173"> - <option name="RIGHT_MARGIN" value="100" /> <option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" /> + <Objective-C> + <option name="KEEP_CASE_EXPRESSIONS_IN_ONE_LINE" value="true" /> + <option name="FUNCTION_PARAMETERS_ALIGN_MULTILINE" value="false" /> + <option name="FUNCTION_CALL_ARGUMENTS_ALIGN_MULTILINE" value="false" /> + <option name="SPACE_BEFORE_TEMPLATE_DECLARATION_LT" value="true" /> + <option name="SPACE_BEFORE_POINTER_IN_DECLARATION" value="false" /> + <option name="SPACE_AFTER_POINTER_IN_DECLARATION" value="true" /> + <option name="SPACE_BEFORE_REFERENCE_IN_DECLARATION" value="false" /> + <option name="SPACE_AFTER_REFERENCE_IN_DECLARATION" value="true" /> + </Objective-C> <Objective-C-extensions> <extensions> <pair source="cpp" header="hpp" fileNamingConvention="PASCAL_CASE" /> @@ -9,6 +18,12 @@ </extensions> </Objective-C-extensions> <codeStyleSettings language="ObjectiveC"> + <option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" /> + <option name="ALIGN_MULTILINE_FOR" value="false" /> + <option name="ALIGN_MULTILINE_ASSIGNMENT" value="false" /> + <option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="false" /> + <option name="METHOD_CALL_CHAIN_WRAP" value="1" /> + <option name="ENUM_CONSTANTS_WRAP" value="2" /> <indentOptions> <option name="CONTINUATION_INDENT_SIZE" value="4" /> <option name="USE_TAB_CHARACTER" value="true" /> diff --git a/ci/clang-format.sh b/ci/clang-format.sh new file mode 100755 index 0000000000000000000000000000000000000000..d8718f524a3230ced99febabba5cdd08b1e72bf0 --- /dev/null +++ b/ci/clang-format.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# +# Edit files, performing code style corrections using clang-format +# +# Usage: +# $ ci/clang-format.sh +# + +echo -e "\033[0;34mRunning clang-format...\033[0m" + +cd "$(dirname "$0")" +clang-format-7 -i `find ../src/ ../inc/ ../test/ -type f -regextype posix-egrep -regex '.*\.(cpp|hpp|c|h)'` \ + -verbose $@ diff --git a/ci/vera.sh b/ci/vera.sh index 470c348bf7e4d999de64b3e58df311a444c87bcc..4481cfb2b2b49d904725a211d4c58b51fe4c4048 100755 --- a/ci/vera.sh +++ b/ci/vera.sh @@ -10,4 +10,4 @@ echo -e "\033[0;34mRunning vera++...\033[0m" cd "$(dirname "$0")/.." -vera++ --error --profile custom `find src inc test -type f -regextype posix-egrep -regex '.*\.(cpp|hpp|c|h)'` +vera++ --error --parameter max-line-length=120 --profile custom `find src inc test -type f -regextype posix-egrep -regex '.*\.(cpp|hpp|c|h)'` diff --git a/src/Service.cpp b/src/Service.cpp new file mode 100644 index 0000000000000000000000000000000000000000..66fdd045bb9f777cea939f8c32fb344a995263a5 --- /dev/null +++ b/src/Service.cpp @@ -0,0 +1 @@ +#include "Service.hpp"