Skip to content

Commit

Permalink
Update vscode and clang configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
Optiroc committed Mar 20, 2024
1 parent 5017dc7 commit e99dcbf
Show file tree
Hide file tree
Showing 17 changed files with 1,086 additions and 957 deletions.
103 changes: 97 additions & 6 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,15 +1,106 @@
---
BasedOnStyle: LLVM
ColumnLimit: 130
ColumnLimit: 120
---
Language: Cpp
IndentWidth: 4
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
ColumnLimit: 130
MaxEmptyLinesToKeep: 2
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: Right
AlignEscapedNewlines: DontAlign
AlignOperands: AlignAfterOperator
AlignTrailingComments:
Kind: Always
OverEmptyLines: 1
AllowShortBlocksOnASingleLine: Always
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: WithoutElse
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterExternBlock: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
CompactNamespaces: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 2
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: true
DerivePointerAlignment: false
MaxEmptyLinesToKeep: 2
FixNamespaceComments: true
IncludeBlocks: Preserve
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: false
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: BeforeHash
IndentWrappedFunctionNames: false
InsertBraces: true
InsertNewlineAtEOF: true
InsertTrailingCommas: None
KeepEmptyLinesAtEOF: false
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: OuterScope
LineEnding: LF
NamespaceIndentation: None
PackConstructorInitializers: Never
PointerAlignment: Left
SortIncludes: false
PPIndentWidth: -1
QualifierAlignment: Left
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveParentheses: Leave
RemoveSemicolon: false
SeparateDefinitionBlocks: Always
ShortNamespaceLines: 5
SortIncludes: CaseInsensitive
SortUsingDeclarations: Lexicographic
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: false
SpaceBeforeParens: ControlStatementsExceptControlMacros
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParens: Never
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never
...
47 changes: 47 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Checks: '-*,
cppcoreguidelines-init-variables,
cppcoreguidelines-prefer-member-initializer,
misc-confusable-identifiers,
misc-const-correctness,
misc-definitions-in-headers,
misc-header-include-cycle,
misc-include-cleaner,
misc-misleading-bidirectional,
misc-misleading-identifier,
misc-misplaced-const,
misc-redundant-expression,
misc-unused-parameters,
misc-unused-using-decls,
modernize-concat-nested-namespaces,
modernize-deprecated-headers,
modernize-loop-convert,
modernize-pass-by-value,
modernize-redundant-void-arg,
modernize-shrink-to-fit,
modernize-use-auto,
modernize-use-bool-literals,
modernize-use-emplace,
modernize-use-nullptr,
modernize-use-starts-ends-with,
modernize-use-std-numbers,
performance-faster-string-find,
performance-for-range-copy,
performance-implicit-conversion-in-loop,
performance-inefficient-algorithm,
performance-inefficient-string-concatenation,
performance-inefficient-vector-operation,
readability-string-compare,
readability-braces-around-statements,
readability-identifier-length,
readability-identifier-naming,
readability-string-compare,
'
WarningsAsErrors: true
FormatStyle: file
CheckOptions:
- key: readability-identifier-length.MinimumLoopCounterNameLength
value: 2
- key: readability-identifier-length.MinimumParameterNameLength
value: 2
- key: readability-identifier-length.MinimumVariableNameLength
value: 2
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"llvm-vs-code-extensions.vscode-clangd",
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cmake-tools"
]
}
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
"test/data/public/rom1.sfc"
],
"preLaunchTask": "${defaultBuildTask}",
},
{
"name": "Test",
"type": "lldb",
"request": "launch",
"cwd": "${workspaceFolder}/test",
"program": "${workspaceFolder}/test/build/test",
"args": [],
"preLaunchTask": "CMake: build test",
}
]
}
22 changes: 20 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "cmake",
"label": "CMake: configure",
"command": "configure",
"targets": [
"all"
]
},
{
"type": "cmake",
"label": "CMake: build",
"command": "build",
"dependsOn": [
"CMake: configure"
],
"targets": [
"all"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
}
},
{
"type": "shell",
"label": "CMake: build test",
"command": "cmake -Bbuild && cmake --build build --parallel 4",
"options": {
"cwd": "${workspaceFolder}/test"
}
}
]
}
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ project(superfamicheck LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)

include_directories(include)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
Expand Down
2 changes: 2 additions & 0 deletions compile_flags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
-std=c++20
-Wall
-Wextra
-Iinclude
-isystem/usr/local/include
2 changes: 2 additions & 0 deletions include/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
"DisableFormat": true
1 change: 1 addition & 0 deletions include/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Checks: ''
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e99dcbf

Please sign in to comment.