forked from pezy/CppPrimer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/pezy/master'
- Loading branch information
Showing
458 changed files
with
12,053 additions
and
16,194 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,65 @@ | ||
--- | ||
Language: Cpp | ||
# BasedOnStyle: LLVM | ||
AccessModifierOffset: -4 | ||
AlignAfterOpenBracket: true | ||
AlignEscapedNewlinesLeft: false | ||
AlignOperands: true | ||
AlignTrailingComments: true | ||
AlignConsecutiveAssignments: false | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortIfStatementsOnASingleLine: true | ||
AllowShortLoopsOnASingleLine: true | ||
AllowShortFunctionsOnASingleLine: Inline | ||
AlwaysBreakAfterDefinitionReturnType: false | ||
AlwaysBreakTemplateDeclarations: false | ||
AlwaysBreakBeforeMultilineStrings: false | ||
BreakBeforeBinaryOperators: None | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializersBeforeComma: false | ||
BinPackParameters: true | ||
BinPackArguments: true | ||
ColumnLimit: 80 | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
ConstructorInitializerIndentWidth: 4 | ||
DerivePointerAlignment: false | ||
ExperimentalAutoDetectBinPacking: false | ||
IndentCaseLabels: false | ||
IndentWrappedFunctionNames: false | ||
IndentFunctionDeclarationAfterType: false | ||
MaxEmptyLinesToKeep: 1 | ||
KeepEmptyLinesAtTheStartOfBlocks: true | ||
NamespaceIndentation: None | ||
ObjCBlockIndentWidth: 2 | ||
ObjCSpaceAfterProperty: false | ||
ObjCSpaceBeforeProtocolList: true | ||
PenaltyBreakBeforeFirstCallParameter: 19 | ||
PenaltyBreakComment: 300 | ||
PenaltyBreakString: 1000 | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyExcessCharacter: 1000000 | ||
PenaltyReturnTypeOnItsOwnLine: 60 | ||
PointerAlignment: Left | ||
SpacesBeforeTrailingComments: 1 | ||
Cpp11BracedListStyle: true | ||
Standard: Cpp11 | ||
IndentWidth: 4 | ||
TabWidth: 4 | ||
UseTab: Never | ||
BreakBeforeBraces: Stroustrup | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
SpacesInAngles: false | ||
SpaceInEmptyParentheses: false | ||
SpacesInCStyleCastParentheses: false | ||
SpaceAfterCStyleCast: false | ||
SpacesInContainerLiterals: true | ||
SpaceBeforeAssignmentOperators: true | ||
ContinuationIndentWidth: 4 | ||
CommentPragmas: '^ IWYU pragma:' | ||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] | ||
SpaceBeforeParens: ControlStatements | ||
DisableFormat: false | ||
... |
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,36 @@ | ||
# Contributing to CppPrimer | ||
|
||
Please ensure your pull request adheres to the following guidelines: | ||
|
||
1. No tabs, Use only spaces, and indent **4 space** at a time. | ||
2. No `using namespace std;` | ||
3. Put **spaces** after each **semicolon**, around **operators**. | ||
```cpp | ||
for(auto i=0;i!=size;++i) // Bad | ||
for (auto i = 0; i != size; ++i) // Good | ||
auto epsilon=2*gamma-delta*pi; // Bad | ||
auto epsilon = 2 * gamma - delta * pi; // Good | ||
``` | ||
4. Put **braces** to next line in function(such as `main()`), **otherwise, End of line**. | ||
```cpp | ||
int main() | ||
{ | ||
Sales_item total; | ||
if (std::cin >> total) { | ||
Sales_item trans; | ||
while (std::cin >> trans) { | ||
//... | ||
} | ||
} | ||
} | ||
``` | ||
|
||
If you intall **[ClangFormat](http://clang.llvm.org/docs/ClangFormat.html)**, You wouldn't care about the format, just run the command: | ||
```sh | ||
clang-format -i your-code.cpp | ||
``` | ||
|
||
#### Tips for good commits and issues. | ||
|
||
1. Read up on [Github Flavored Markdown](https://help.github.com/articles/github-flavored-markdown) | ||
2. [Closing Issues via Commit Messages](https://github.com/tiimgreen/github-cheat-sheet#closing-issues-via-commit-messages) is encouraged. |
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.