diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..674ee46 --- /dev/null +++ b/.clang-format @@ -0,0 +1,21 @@ +BasedOnStyle: LLVM +IndentWidth: 4 +UseTab: Never +ColumnLimit: 160 +BreakBeforeBraces: Allman +SeparateDefinitionBlocks: Always +# BreakTemplateDeclarations: Yes +BraceWrapping: + AfterClass: true + AfterControlStatement: true + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterStruct: true + AfterUnion: true + BeforeCatch: true + BeforeElse: true + IndentBraces: false + +IndentRequiresClause: false + diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..825dcb5 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,36 @@ +--- +Checks: 'clang-diagnostic-*,clang-analyzer-*,-modernize-use-trailing-return-type,clang-diagnostic-narrowing-conversion,misc-include-cleaner' +WarningsAsErrors: '*' +HeaderFilterRegex: '' +FormatStyle: google +CheckOptions: + - key: cert-dcl16-c.NewSuffixes + value: 'L;LL;LU;LLU' + - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField + value: '0' + - key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors + value: '1' + - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic + value: '1' + - key: google-readability-braces-around-statements.ShortStatementLines + value: '1' + - key: google-readability-function-size.StatementThreshold + value: '800' + - key: google-readability-namespace-comments.ShortNamespaceLines + value: '10' + - key: google-readability-namespace-comments.SpacesBeforeComments + value: '2' + - key: modernize-loop-convert.MaxCopySize + value: '16' + - key: modernize-loop-convert.MinConfidence + value: reasonable + - key: modernize-loop-convert.NamingStyle + value: CamelCase + - key: modernize-pass-by-value.IncludeStyle + value: llvm + - key: modernize-replace-auto-ptr.IncludeStyle + value: llvm + - key: modernize-use-nullptr.NullMacros + value: 'NULL' +... + diff --git a/src/main.cpp b/src/main.cpp index 1f0308c..a231605 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,7 @@ #include -int main() { - std::cout << "Hello World" << std::endl; - return 0; + +int main() +{ + std::cout << "Hello World" << std::endl; + return 0; }