Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
BasedOnStyle: WebKit
UseTab: Always
TabWidth: 4
---
Language: Cpp


######################
# The major settings
######################

# Always break before braces
# Disabled to allow manual control e.g. of extern "C"
#BreakBeforeBraces: Allman

# 120 column limit (counting tabs as 4)
ColumnLimit: 120


#########################################
# Everything else in alphabetical order
#########################################


# When breaking between function arguments, align subsequent lines with the first
# argument on the first line
AlignAfterOpenBracket: Align

# When line-breaking into multiple lines that require escaping, line up the backslash
# escapes as far left as possible. If the last line is longer than any of the previous
# ones, this means that the backslash might actually be to the left of the last line's
# right most point.
AlignEscapedNewlines: Left

# Only allow single-line function declarations in classes
AllowShortFunctionsOnASingleLine: Inline

# 'template <...>' always goes on its own line
AlwaysBreakTemplateDeclarations: true

# When line-breaking binary operators, put the operator on the new line, except for =
BreakBeforeBinaryOperators: NonAssignment

# Commas and colons in constructors begin new lines
BreakBeforeInheritanceComma: true

# We have some very long lines with -----, don't break those
CommentPragmas: ---------

# Macros which should be treated as for-each constructs...
# Does not apply to WolframRTL
#ForEachMacros: ['forString', 'forString_isASCII']

# Indent cases in switch statements
IndentCaseLabels: true

# If a function declaration is forced to break before the arguments (e.g.,
# between the return type and the function name), then indent after the break.
IndentWrappedFunctionNames: true

# Add comments after the closing brace of a namespace to indicate which
# namespace is being closed
FixNamespaceComments: true

# This drops the comment breaking penality just enough so that comments will tend to
# get broken rather than other kinds of line-breaking happening. We don't want,
# for example, to break function calls after the open paren in order to get an entire
# comment onto one line.
PenaltyBreakComment: 30

# We do want it to be able to go a bit over 120 characters...don't penalize too much
PenaltyExcessCharacter: 3

# We'll still break after the return type when absolutely necessary (and indent
# per the IndentWrappedFunctionNames setting), but we prefer to keep the function
# name with the return type and break after the opening paren. E.g.,
# returntype funcname(
# arg1);
PenaltyReturnTypeOnItsOwnLine: 500

# Not sure if we want to sort includes, but since it could definitely break things
# keep off for now.
SortIncludes: false

# For comments trailing code, put two spaces between the code and the comment.
SpacesBeforeTrailingComments: 1

# Use a space after a C style cast
SpaceAfterCStyleCast: true

# Use tabs for indentation and line continuation, but not for every whitespace everywhere
UseTab: ForContinuationAndIndentation

# Manual control of options for break before braces
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyNamespace: true
SplitEmptyRecord: true
# Don't indent code inside extern "C" {}
AfterExternBlock: false

# Future clang version options

# version 11 (doesn't work)
#IndentExternBlock: NoIndent

# version 13
#AlignArrayOfStructures : Left
38 changes: 19 additions & 19 deletions .github/workflows/CompileBuildTestCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ jobs:
}
wolfram -runfirst 'Unprotect[$EvaluationEnvironment];$EvaluationEnvironment=\"Script\";Protect[$EvaluationEnvironment]' -script ${{ env.WOLFRAM_LIBRARY_BUILD_SCRIPT }}
- name: Archive compiled libraries
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.WOLFRAM_SYSTEM_ID }}
path: ${{ env.WOLFRAM_LIBRARY_BUILD_OUTPUT }}/${{ env.WOLFRAM_SYSTEM_ID }}
Compile-MacOSX-x86-64:
name: Compile-MacOSX-x86-64
runs-on: macos-12
runs-on: macos-13
env:
WOLFRAM_LIBRARY_BUILD_OUTPUT: LibraryResources/
WOLFRAM_LIBRARY_BUILD_SCRIPT: ./Scripts/Compile.wls
Expand Down Expand Up @@ -124,15 +124,15 @@ jobs:
fi
wolframscript -runfirst 'CompoundExpression[Unprotect[\$EvaluationEnvironment],Set[\$EvaluationEnvironment,SymbolName[Script]],Protect[\$EvaluationEnvironment]]' -script ${{ env.WOLFRAM_LIBRARY_BUILD_SCRIPT }}
- name: Archive compiled libraries
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.WOLFRAM_SYSTEM_ID }}
path: ${{ env.WOLFRAM_LIBRARY_BUILD_OUTPUT }}/${{ env.WOLFRAM_SYSTEM_ID }}
Compile-Linux-x86-64:
name: Compile-Linux-x86-64
runs-on: ubuntu-latest
container:
image: wolframresearch/wolframengine:13.0.1
image: wolframresearch/wolframengine:13.3
options: --user root
env:
WOLFRAM_LIBRARY_BUILD_SCRIPT: ./Scripts/Compile.wls
Expand All @@ -155,7 +155,7 @@ jobs:
fi
wolframscript -script ${{ env.WOLFRAM_LIBRARY_BUILD_SCRIPT }}
- name: Archive compiled libraries
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.WOLFRAM_SYSTEM_ID }}
path: ${{ env.WOLFRAM_LIBRARY_BUILD_OUTPUT }}/${{ env.WOLFRAM_SYSTEM_ID }}
Expand All @@ -164,7 +164,7 @@ jobs:
needs: [Compile-Windows-x86-64, Compile-MacOSX-x86-64, Compile-Linux-x86-64]
runs-on: ubuntu-latest
container:
image: wolframresearch/wolframengine:13.0.1
image: wolframresearch/wolframengine:13.3
options: --user root
env:
WOLFRAM_SYSTEM_ID: Linux-x86-64
Expand All @@ -174,7 +174,7 @@ jobs:
uses: actions/checkout@v3
- name: DownloadCompilationArtifacts
id: download-compilation-artifacts-step
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: LibraryResources
- name: BuildMX
Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:
resource_system_base: https://www.wolframcloud.com/obj/resourcesystem/api/1.0
- name: UploadArtifact
id: upload-build-artifacts-step
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: ${{ env.PACLET_BUILD_DIR }}
if-no-files-found: ignore
Expand All @@ -228,7 +228,7 @@ jobs:
path: ${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}
key: wolframengine-${{ env.WOLFRAM_SYSTEM_ID }}-${{ env.WOLFRAMENGINE_CACHE_KEY }}
- name: DownloadBuiltPaclet
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifact
path: build
Expand Down Expand Up @@ -273,15 +273,15 @@ jobs:
- name: UploadWorkflowValues
id: upload-workflow-values-step
if: always() && env.PACLET_WORKFLOW_VALUES
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: paclet-workflow-values
path: ${{ env.PACLET_WORKFLOW_VALUES }}
if-no-files-found: ignore
Test-MacOSX-x86-64:
name: Test-MacOSX-x86-64
needs: [BuildPaclet]
runs-on: macos-12
runs-on: macos-13
env:
WOLFRAM_SYSTEM_ID: MacOSX-x86-64
WOLFRAMENGINE_CACHE_KEY: WolframEngine-A
Expand All @@ -299,7 +299,7 @@ jobs:
path: ${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}
key: wolframengine-${{ env.WOLFRAM_SYSTEM_ID }}-${{ env.WOLFRAMENGINE_CACHE_KEY }}
- name: DownloadBuiltPaclet
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifact
path: build
Expand Down Expand Up @@ -331,7 +331,7 @@ jobs:
- name: UploadWorkflowValues
id: upload-workflow-values-step
if: always() && env.PACLET_WORKFLOW_VALUES
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: paclet-workflow-values
path: ${{ env.PACLET_WORKFLOW_VALUES }}
Expand All @@ -341,7 +341,7 @@ jobs:
needs: [BuildPaclet]
runs-on: ubuntu-latest
container:
image: wolframresearch/wolframengine:13.0.1
image: wolframresearch/wolframengine:13.3
options: --user root
env:
WOLFRAM_SYSTEM_ID: Linux-x86-64
Expand All @@ -358,14 +358,14 @@ jobs:
fi
wolframscript Scripts/TestPaclet.wls
- name: DownloadBuiltPaclet
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifact
path: build
- name: UploadWorkflowValues
id: upload-workflow-values-step
if: always() && env.PACLET_WORKFLOW_VALUES
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: paclet-workflow-values
path: ${{ env.PACLET_WORKFLOW_VALUES }}
Expand All @@ -375,7 +375,7 @@ jobs:
needs: [Test-Windows-x86-64, Test-MacOSX-x86-64, Test-Linux-x86-64]
runs-on: ubuntu-latest
container:
image: wolframresearch/wolframengine:13.0.1
image: wolframresearch/wolframengine:13.3
options: --user root
env:
WOLFRAM_SYSTEM_ID: Linux-x86-64
Expand All @@ -395,8 +395,8 @@ jobs:
- name: UploadWorkflowValues
id: upload-workflow-values-step
if: always() && env.PACLET_WORKFLOW_VALUES
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: paclet-workflow-values
path: ${{ env.PACLET_WORKFLOW_VALUES }}
if-no-files-found: ignore
if-no-files-found: ignore
Loading
Loading