-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from Vikort/clang-format
- Loading branch information
Showing
252 changed files
with
17,834 additions
and
16,818 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
Language: Cpp | ||
# BasedOnStyle: Google | ||
AccessModifierOffset: -2 | ||
AlignAfterOpenBracket: AlwaysBreak | ||
AlignConsecutiveAssignments: false | ||
AlignConsecutiveDeclarations: false | ||
AlignEscapedNewlines: DontAlign | ||
AlignOperands: true | ||
AlignTrailingComments: true | ||
AllowAllArgumentsOnNextLine: true | ||
AllowAllConstructorInitializersOnNextLine: false | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: None | ||
AllowShortLambdasOnASingleLine: Empty | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: true | ||
AlwaysBreakTemplateDeclarations: Yes | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BraceWrapping: | ||
AfterCaseLabel: true | ||
AfterClass: true | ||
AfterControlStatement: Always | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
AfterObjCDeclaration: false | ||
AfterStruct: true | ||
AfterUnion: true | ||
AfterExternBlock: true | ||
BeforeCatch: true | ||
BeforeElse: true | ||
# BeforeLambdaBody: true | ||
# BeforeWhile: true | ||
IndentBraces: false | ||
SplitEmptyFunction: true | ||
SplitEmptyRecord: true | ||
SplitEmptyNamespace: true | ||
|
||
BreakBeforeBinaryOperators: None | ||
BreakBeforeBraces: Custom | ||
BreakBeforeInheritanceComma: true | ||
BreakInheritanceList: BeforeComma | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializersBeforeComma: false | ||
BreakConstructorInitializers: BeforeComma | ||
BreakAfterJavaFieldAnnotations: false | ||
BreakStringLiterals: true | ||
ColumnLimit: 120 | ||
CommentPragmas: '^\s*(\*)?\s*\\.+' | ||
CompactNamespaces: false | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
ConstructorInitializerIndentWidth: 2 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: true | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
# EmptyLineBeforeAccessModifier: Always | ||
ExperimentalAutoDetectBinPacking: false | ||
FixNamespaceComments: true | ||
ForEachMacros: | ||
- foreach | ||
- Q_FOREACH | ||
- BOOST_FOREACH | ||
IncludeBlocks: Regroup | ||
IncludeCategories: | ||
- Regex: '^<(gtest|gmock)/.*' | ||
Priority: 1 | ||
|
||
- Regex: '^<sc-memory/*.*' | ||
Priority: 11 | ||
|
||
- Regex: '^"sc_*.*' | ||
Priority: 21 | ||
|
||
- Regex: '.*' | ||
Priority: 100 | ||
# IncludeIsMainRegex: '([-_](test|unittest))?$' | ||
IndentCaseLabels: false | ||
IndentPPDirectives: AfterHash | ||
IndentWidth: 2 | ||
IndentWrappedFunctionNames: false | ||
JavaScriptQuotes: Leave | ||
JavaScriptWrapImports: true | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
MacroBlockBegin: '' | ||
MacroBlockEnd: '' | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ObjCBinPackProtocolList: Never | ||
ObjCBlockIndentWidth: 2 | ||
ObjCSpaceAfterProperty: false | ||
ObjCSpaceBeforeProtocolList: true | ||
PenaltyBreakAssignment: 2 | ||
PenaltyBreakBeforeFirstCallParameter: 1 | ||
PenaltyBreakComment: 300 | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyBreakString: 1000 | ||
PenaltyBreakTemplateDeclaration: 10 | ||
PenaltyExcessCharacter: 1000 | ||
PenaltyReturnTypeOnItsOwnLine: 2000 | ||
PointerAlignment: Middle | ||
RawStringFormats: | ||
- Language: Cpp | ||
Delimiters: | ||
- cc | ||
- CC | ||
- cpp | ||
- Cpp | ||
- CPP | ||
- 'c++' | ||
- 'C++' | ||
CanonicalDelimiter: '' | ||
BasedOnStyle: google | ||
- Language: TextProto | ||
Delimiters: | ||
- pb | ||
- PB | ||
- proto | ||
- PROTO | ||
EnclosingFunctions: | ||
- EqualsProto | ||
- EquivToProto | ||
- PARSE_PARTIAL_TEXT_PROTO | ||
- PARSE_TEST_PROTO | ||
- PARSE_TEXT_PROTO | ||
- ParseTextOrDie | ||
- ParseTextProtoOrDie | ||
CanonicalDelimiter: '' | ||
BasedOnStyle: google | ||
ReflowComments: true | ||
SortIncludes: false | ||
SortUsingDeclarations: true | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterLogicalNot: false | ||
SpaceAfterTemplateKeyword: true | ||
# SpaceAroundPointerQualifiers: After/Both | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCpp11BracedList: false | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeInheritanceColon: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 2 | ||
SpacesInAngles: false | ||
SpacesInContainerLiterals: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
Standard: Auto | ||
StatementMacros: | ||
- Q_UNUSED | ||
- QT_REQUIRE_VERSION | ||
TabWidth: 2 | ||
UseTab: Never | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: clang-format-check | ||
name: clang-format-check | ||
exclude: (generated/|thidrparty/|scs/|/json) | ||
entry: scripts/ci/check-formatting.sh | ||
language: script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Copyright Tomas Zeman 2019-2020. | ||
# Distributed under the Boost Software License, Version 1.0. | ||
# (See accompanying file LICENSE_1_0.txt or copy at | ||
# http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
function(prefix_clangformat_setup prefix) | ||
if(NOT CLANGFORMAT_EXECUTABLE) | ||
set(CLANGFORMAT_EXECUTABLE clang-format) | ||
endif() | ||
|
||
if(NOT EXISTS ${CLANGFORMAT_EXECUTABLE}) | ||
find_program(clangformat_executable_tmp ${CLANGFORMAT_EXECUTABLE}) | ||
if(clangformat_executable_tmp) | ||
set(CLANGFORMAT_EXECUTABLE ${clangformat_executable_tmp}) | ||
unset(clangformat_executable_tmp) | ||
else() | ||
message(FATAL_ERROR "ClangFormat: ${CLANGFORMAT_EXECUTABLE} not found! Aborting") | ||
endif() | ||
endif() | ||
|
||
foreach(clangformat_source ${ARGN}) | ||
get_filename_component(clangformat_source ${clangformat_source} ABSOLUTE) | ||
list(APPEND clangformat_sources ${clangformat_source}) | ||
endforeach() | ||
|
||
add_custom_target(${prefix}_clangformat | ||
COMMAND | ||
${CLANGFORMAT_EXECUTABLE} | ||
-style=file | ||
-fallback-style=none | ||
-i | ||
${clangformat_sources} | ||
WORKING_DIRECTORY | ||
${CMAKE_SOURCE_DIR} | ||
COMMENT | ||
"Formatting ${prefix} with ${CLANGFORMAT_EXECUTABLE} ..." | ||
) | ||
|
||
add_custom_target(${prefix}_clangformat_check | ||
COMMAND | ||
${CLANGFORMAT_EXECUTABLE} | ||
-style=file | ||
-fallback-style=none | ||
--Werror | ||
--dry-run | ||
${clangformat_sources} | ||
WORKING_DIRECTORY | ||
${CMAKE_SOURCE_DIR} | ||
COMMENT | ||
"Check formatting ${prefix} with ${CLANGFORMAT_EXECUTABLE} ..." | ||
) | ||
|
||
if(TARGET clangformat) | ||
add_dependencies(clangformat ${prefix}_clangformat) | ||
add_dependencies(clangformat_check ${prefix}_clangformat_check) | ||
else() | ||
add_custom_target(clangformat DEPENDS ${prefix}_clangformat) | ||
add_custom_target(clangformat_check DEPENDS ${prefix}_clangformat_check) | ||
endif() | ||
endfunction() | ||
|
||
function(clangformat_setup) | ||
prefix_clangformat_setup(${PROJECT_NAME} ${ARGN}) | ||
endfunction() | ||
|
||
function(target_clangformat_setup target) | ||
get_target_property(target_sources ${target} SOURCES) | ||
list(FILTER target_sources EXCLUDE REGEX \(.*/generated/.*|.*/scs/*.|.*/json/.*\)) | ||
prefix_clangformat_setup(${target} ${target_sources}) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Build with Visual Studio 2013: | ||
|
||
* install [jre](http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html) | ||
* downlaod source code of [sc-machine](https://github.com/deniskoronchik/sc-machine). | ||
* downlaod source code of [sc-machine](https://github.com/ostis-ai/sc-machine). | ||
* Run cmake for Visual Studio 2013 with param `CMAKE_PREFIX_PATH=<path to QT>`. For example: `CMAKE_PREFIX_PATH=D:\Qt\5.5\msvc2013_64\)` | ||
* Setup redis for Windows: [https://github.com/MSOpenTech/redis/releases](https://github.com/MSOpenTech/redis/releases) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
### Initialize | ||
To initialize your repo do: | ||
* make fork from `https://github.com/ostis-dev/sc-machine` | ||
* make fork from `https://github.com/ostis-ai/sc-machine` | ||
* clone your fork to your machine and prepare | ||
```sh | ||
git clone [email protected]:yourlogin/sc-machine.git | ||
cd sc-machine | ||
git config --global user.name "Your Name" | ||
git config --global user.email [email protected] | ||
git remote add upstream [email protected]:ostis-dev/sc-machine.git | ||
git remote add upstream [email protected]:ostis-ai/sc-machine.git | ||
``` | ||
### Update | ||
To update your master from `upstream` use: | ||
|
@@ -35,3 +35,11 @@ git rebase --abort | |
|
||
### Common rules | ||
* use `git rebase` instead of `merge`. [More documentation about this command](https://git-scm.com/docs/git-rebase) This command just try to apply your commits (from current branch to commits in specified branch) | ||
|
||
### Git hooks | ||
|
||
To setup `pre-commit` hook run: | ||
```shell | ||
cd sc-machine | ||
pre-commit install | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
termcolor | ||
tornado | ||
tornado | ||
pre-commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.