Skip to content
Merged
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
134 changes: 134 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# SPDX-FileCopyrightText: 2021 SeisSol Group
#
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-LicenseComments: Full text under /LICENSE and /LICENSES/
#
# SPDX-FileContributor: Author lists in /AUTHORS and /CITATION.cff

Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Regroup
IncludeCategories:
# keep the doctest headers in front
- Regex: '^(<|")doctest'
Priority: 1
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 3
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 4
- Regex: '.*'
Priority: 2
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
QualifierAlignment: Left
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never
9 changes: 9 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-FileCopyrightText: 2026 SeisSol Group
#
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-LicenseComments: Full text under /LICENSE and /LICENSES/
#
# SPDX-FileContributor: Author lists in /AUTHORS and /CITATION.cff

# apply clang-format and pre-commit
a557b85c5e4b925fc739aa1ded1a76ccde4ee6fa
21 changes: 21 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: 2025 SeisSol Group
#
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-LicenseComments: Full text under /LICENSE and /LICENSES/
#
# SPDX-FileContributor: Author lists in /AUTHORS and /CITATION.cff

name: pre-commit
on:
- push

jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- uses: pre-commit/action@v3.0.1
92 changes: 92 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# SPDX-FileCopyrightText: 2025 SeisSol Group
#
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-LicenseComments: Full text under /LICENSE and /LICENSES/
#
# SPDX-FileContributor: Author lists in /AUTHORS and /CITATION.cff

---

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-merge-conflict
name: '[GENERIC] merge conflict check'
- id: check-symlinks
name: '[GENERIC] symlink check'
- id: destroyed-symlinks
name: '[GENERIC] detect broken symlinks'
- id: detect-private-key
name: '[GENERIC] detect private keys uploaded by accident'
- id: check-case-conflict
name: '[GENERIC] detect OS file naming case conflicts'
- id: check-executables-have-shebangs
name: '[GENERIC] check for shebangs in executable files'
- id: check-illegal-windows-names
name: '[GENERIC] detect illegal Windows file names'
- id: check-json
name: '[JSON] check'
- id: check-xml
name: '[XML] check'
- id: check-shebang-scripts-are-executable
name: '[GENERIC] check that shebang-containing files are executable'


- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.18.1
hooks:
- id: markdownlint-cli2
name: '[MARKDOWN] lint'

#- repo: https://github.com/fsfe/reuse-tool
# rev: v6.0.0
# hooks:
# - id: reuse
# name: '[GENERIC] REUSE compatibiltiy'

#- repo: https://github.com/psf/black-pre-commit-mirror
# rev: 25.1.0
# hooks:
# - id: black
# files: ^(?!preprocessing|postprocessing)
# name: '[PYTHON] black'
#- repo: https://github.com/pycqa/isort
# rev: 6.0.1
# hooks:
# - id: isort
# files: ^(?!preprocessing|postprocessing)
# args: ["--profile", "black"]
# name: '[PYTHON] isort'
- repo: https://github.com/pycqa/bandit
rev: 1.8.6
hooks:
- id: bandit
args: ["--confidence-level", "high", "--severity-level", "high"]
name: '[PYTHON] bandit'
#- repo: https://github.com/pycqa/flake8
# rev: '7.3.0'
# hooks:
# - id: flake8
# files: ^(?!preprocessing|postprocessing)
# name: '[PYTHON] Flake8'

- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: 'v1.0.0'
hooks:
- id: sphinx-lint
name: '[SPHINX/RST] sphinx lint'

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v22.1.0'
hooks:
- id: clang-format
name: '[C++] clang-format'

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
name: '[GENERIC] newline eof'
- id: trailing-whitespace
name: '[GENERIC] remove trailing whitespace'
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
A collection of useful tools for visualization of [SeisSol](http://www.seissol.org)'s results.
# Postprocessing Tools for SeisSol

Useful tools for visualizing [SeisSol](http://www.seissol.org) results.
3 changes: 1 addition & 2 deletions compress_xmdf/SConstruct
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/python
##
# @file
# This file is part of SeisSol.
Expand Down Expand Up @@ -76,4 +75,4 @@ Export('env')
SConscript('src/SConscript', variant_dir='#/build/'+buildDir, src_dir='#/', duplicate=0)
Import('env')

env.Program('#/build/compress-xdmf', env.sourceFiles)
env.Program('#/build/compress-xdmf', env.sourceFiles)
3 changes: 1 addition & 2 deletions compress_xmdf/src/SConscript
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/python
##
# @file
# This file is part of SeisSol.
Expand Down Expand Up @@ -44,4 +43,4 @@ sourceFiles = ['main.cpp']
for f in sourceFiles:
env.sourceFiles.append(env.Object(f))

Export('env')
Export('env')
24 changes: 10 additions & 14 deletions compress_xmdf/src/hdf5_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* @file
* This file is part of SeisSol.
*
* @author Sebastian Rettenberger (sebastian.rettenberger AT tum.de, http://www5.in.tum.de/wiki/index.php/Sebastian_Rettenberger)
* @author Sebastian Rettenberger (sebastian.rettenberger AT tum.de,
* http://www5.in.tum.de/wiki/index.php/Sebastian_Rettenberger)
*
* @section LICENSE
* Copyright (c) 2017, SeisSol Group
Expand Down Expand Up @@ -40,21 +41,16 @@
#ifndef HDF5_HELPER_H
#define HDF5_HELPER_H

#include <hdf5.h>

#include "utils/logger.h"

template<typename T>
static void checkH5Err(T status)
{
if (status < 0)
logError() << "An HDF5 error occurred";
}
#include <hdf5.h>

inline
static hsize_t sizeofType(hid_t type)
{
return H5Tget_size(type);
template <typename T>
static void checkH5Err(T status) {
if (status < 0)
logError() << "An HDF5 error occurred";
}

#endif // HDF5_HELPER_H
inline static hsize_t sizeofType(hid_t type) { return H5Tget_size(type); }

#endif // HDF5_HELPER_H
Loading