-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
2,325 additions
and
1,933 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 |
---|---|---|
@@ -1,47 +1,88 @@ | ||
--- | ||
Language: Cpp | ||
BasedOnStyle: LLVM | ||
AccessModifierOffset: -4 | ||
AccessModifierOffset: -2 | ||
AlignAfterOpenBracket: BlockIndent # New in v14. For earlier clang-format versions, use AlwaysBreak instead. | ||
AlignConsecutiveMacros: false | ||
AlignConsecutiveAssignments: false | ||
AlignConsecutiveDeclarations: false | ||
AlignEscapedNewlines: DontAlign | ||
AlignOperands: false | ||
AlignTrailingComments: false | ||
AllowAllArgumentsOnNextLine: false | ||
AllowAllConstructorInitializersOnNextLine: false | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: Empty | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: Empty | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortLambdasOnASingleLine: All | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: true | ||
AlwaysBreakTemplateDeclarations: Yes | ||
BraceWrapping: | ||
AfterCaseLabel: true | ||
AfterClass: true | ||
AfterControlStatement: true | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
AfterStruct: true | ||
AfterUnion: true | ||
AfterExternBlock: false | ||
BeforeCatch: true | ||
BeforeElse: true | ||
BeforeLambdaBody: true | ||
BeforeWhile: true | ||
SplitEmptyFunction: true | ||
SplitEmptyRecord: true | ||
SplitEmptyNamespace: true | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BreakBeforeBinaryOperators: NonAssignment | ||
BreakBeforeBraces: Attach | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializers: AfterColon | ||
ColumnLimit: 120 | ||
IncludeCategories: | ||
- Regex: '^<.*' | ||
Priority: 1 | ||
- Regex: '^".*' | ||
Priority: 2 | ||
- Regex: '.*' | ||
Priority: 3 | ||
BreakInheritanceList: AfterColon | ||
BreakStringLiterals: false | ||
ColumnLimit: 80 | ||
CompactNamespaces: true | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: true | ||
DerivePointerAlignment: false | ||
FixNamespaceComments: true | ||
IncludeBlocks: Regroup | ||
IncludeCategories: | ||
- Regex: '^<ext/.*\.h>' | ||
Priority: 2 | ||
SortPriority: 0 | ||
CaseSensitive: false | ||
- Regex: '^<.*\.h>' | ||
Priority: 1 | ||
SortPriority: 0 | ||
CaseSensitive: false | ||
- Regex: '^<.*' | ||
Priority: 2 | ||
SortPriority: 0 | ||
CaseSensitive: false | ||
- Regex: '.*' | ||
Priority: 3 | ||
SortPriority: 0 | ||
CaseSensitive: false | ||
IncludeIsMainRegex: '([-_](test|unittest))?$' | ||
IndentCaseBlocks: true | ||
IndentCaseLabels: true | ||
IndentPPDirectives: BeforeHash | ||
IndentWidth: 4 | ||
InsertNewlineAtEOF: true | ||
MacroBlockBegin: '' | ||
MacroBlockEnd: '' | ||
MaxEmptyLinesToKeep: 2 | ||
NamespaceIndentation: All | ||
IndentWrappedFunctionNames: false | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: Inner | ||
PointerAlignment: Left | ||
ReferenceAlignment: Left # New in v13. int &name ==> int& name | ||
ReflowComments: false | ||
SeparateDefinitionBlocks: Always # New in v14. | ||
SortIncludes: CaseSensitive | ||
SortUsingDeclarations: true | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterLogicalNot: false | ||
SpaceAfterTemplateKeyword: false | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCpp11BracedList: true | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeInheritanceColon: false | ||
SpaceBeforeParens: ControlStatements | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 2 | ||
SpacesInAngles: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInContainerLiterals: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
Standard: Auto | ||
TabWidth: 4 | ||
... | ||
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
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
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
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,40 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# let's say you have a C++ project in Nix that you want to work on with CLion so that the Nix dependencies are available | ||
# put this script in your project directory | ||
# then, in Settings -> Build, Execution, Deployment -> Toolchains set CMake to this script | ||
# if you need any extra nix-shell arguments, add them to the invocation at the bottom | ||
|
||
import os | ||
import sys | ||
import shlex | ||
|
||
|
||
def is_test_invocation(args): | ||
# This function checks if the current invocation is for testing. | ||
# You might check for specific CTest arguments or a pattern that matches your testing setup. | ||
# For simplicity, this example looks for a '--test' flag which you might need to adjust | ||
return '--test' in args or 'ctest' in args | ||
|
||
|
||
scriptDir = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
args = list(map(shlex.quote, sys.argv[1:])) | ||
|
||
# Use the cmakeFlags set by Nix if not running --build or tests | ||
if "--build" not in args and not is_test_invocation(args): | ||
args.insert(0, "$cmakeFlags") | ||
|
||
cwd = os.getcwd() | ||
cmd = 'cd ' + cwd + ' && cmake ' + ' '.join(args) | ||
|
||
if is_test_invocation(args): | ||
# Modify cmd for test execution | ||
# Here you might need to adjust the command to work with CTest specifically. | ||
# This could involve using a different command or altering the existing one to suit test execution. | ||
cmd = 'cd ' + cwd + ' && ctest ' + ' '.join(args) # Adjust this line as necessary | ||
|
||
os.chdir(scriptDir) | ||
os.execvp("nix", [ | ||
"nix", "develop", "--command", "bash", "-c", cmd | ||
]) |
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
Oops, something went wrong.