Skip to content

Commit

Permalink
Clang-Format 13: JSON (openPMD#1222)
Browse files Browse the repository at this point in the history
* Clang-Format 13: JSON

Add support for JSON formatting with `clang-format-13`.

X-ref:
- https://burnicki.pl/en/2021/10/19/git-clang-format-json-support-issue.html
- https://clang.llvm.org/docs/ClangFormatStyleOptions.html
- https://reviews.llvm.org/D93528

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
ax3l and pre-commit-ci[bot] authored Mar 8, 2022
1 parent 3cf5291 commit eec3f06
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 164 deletions.
6 changes: 6 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
Language: Cpp

BasedOnStyle: LLVM
Expand Down Expand Up @@ -64,3 +65,8 @@ SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
StatementMacros: ["OPENPMD_private", "OPENPMD_protected"]

---
Language: Json
BasedOnStyle: llvm
...
4 changes: 2 additions & 2 deletions .github/workflows/clang-format/clang-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

if (( $# > 0 )); then
# received arguments, format those files
clang-format-12 -i "$@"
clang-format-13 -i "$@"
else
# received no arguments, find files on our own
find include/ src/ test/ examples/ \
-regextype egrep \
-type f -regex '.*\.(hpp|cpp|hpp\.in)$' \
| xargs clang-format-12 -i
| xargs clang-format-13 -i
fi
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ repos:
- id: check-json
- id: check-toml
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-added-large-files
- id: requirements-txt-fixer
# - id: fix-encoding-pragma
Expand Down Expand Up @@ -61,7 +62,7 @@ repos:
# files: (\.cmake|CMakeLists.txt)(.in)?$

# C++ formatting
# clang-format v12
# clang-format v13
# to run manually, use .github/workflows/clang-format/clang-format.sh
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v13.0.1
Expand Down
310 changes: 155 additions & 155 deletions .rodare.json
Original file line number Diff line number Diff line change
@@ -1,158 +1,158 @@
{
"creators": [
{
"name": "Huebl, Axel",
"affiliation": "Lawrence Berkeley National Laboratory",
"orcid": "0000-0003-1943-7141"
},
{
"name": "Poeschel, Franz",
"affiliation": "Center for Advanced Systems Understanding (CASUS)",
"orcid": "0000-0001-7042-5088"
},
{
"name": "Koller, Fabian",
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"orcid": "0000-0001-8704-1769"
},
{
"name": "Gu, Junmin",
"affiliation": "Lawrence Berkeley National Laboratory",
"orcid": "0000-0002-1521-8534"
}
"creators": [
{
"name": "Huebl, Axel",
"affiliation": "Lawrence Berkeley National Laboratory",
"orcid": "0000-0003-1943-7141"
},
{
"name": "Poeschel, Franz",
"affiliation": "Center for Advanced Systems Understanding (CASUS)",
"orcid": "0000-0001-7042-5088"
},
{
"name": "Koller, Fabian",
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"orcid": "0000-0001-8704-1769"
},
{
"name": "Gu, Junmin",
"affiliation": "Lawrence Berkeley National Laboratory",
"orcid": "0000-0002-1521-8534"
}

],
"contributors": [
{
"affiliation": "EU XFEL GmbH",
"name": "Fortmann-Grote, Carsten",
"orcid": "0000-0002-2579-5546",
"type": "Other"
},
{
"affiliation": "Warsaw University of Technology",
"name": "Stańczak, Dominik",
"orcid": "0000-0001-6291-8843",
"type": "Other"
},
{
"affiliation": "Fermi National Accelerator Laboratory",
"name": "Amundson, James",
"orcid": "0000-0001-6918-2728",
"type": "Other"
},
{
"affiliation": "Anaconda, Inc.",
"name": "Donnelly, Ray",
"type": "Other"
},
{
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"name": "Widera, René",
"orcid": "0000-0003-1642-0459",
"type": "Other"
},
{
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"name": "Zenker, Erik",
"orcid": "0000-0001-9417-8712",
"type": "Other"
},
{
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"name": "Bastrakov, Sergei",
"orcid": "0000-0003-3396-6154",
"type": "Other"
},
{
"affiliation": "Lawrence Berkeley National Laboratory",
"name": "Lehe, Rémi",
"orcid": "0000-0002-3656-9659",
"type": "Other"
},
{
"affiliation": "Lawrence Berkeley National Laboratory",
"name": "Amorim, Lígia Diana",
"orcid": "0000-0002-1445-0032",
"type": "Other"
},
{
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"name": "Bastrakova, Kseniia",
"type": "Other"
},
{
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"name": "Pausch, Richard",
"orcid": "0000-0001-7990-9564",
"type": "Other"
},
{
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"name": "Ordyna, Paweł",
"type": "Other"
},
{
"affiliation": "Oak Ridge National Laboratory",
"name": "Ganyushin, Dmitry",
"orcid": "0000-0001-7337-2161",
"type": "Other"
},
{
"affiliation": "NVIDIA",
"name": "Kirkham, John",
"type": "Other"
},
{
"affiliation": "Perimeter Institute for Theoretical Physics",
"name": "Schnetter, Erik",
"orcid": "0000-0002-4518-9017",
"type": "Other"
},
{
"affiliation": "Lawrence Berkeley National Laboratory",
"name": "Bez, Jean Luca",
"orcid": "0000-0002-3915-1135",
"type": "Other"
}
],
"title": "C++ & Python API for Scientific I/O with openPMD",
"access_right": "open",
"upload_type": "software",
"license": "LGPL-3.0",
"pub_id": "27579",
"description": "openPMD is an open metadata format for open data workflows in open science. This library provides a common high-level API for openPMD writing and reading. It provides a common interface to I/O libraries and file formats such as HDF5 and ADIOS. Where supported, openPMD-api implements both serial and MPI parallel I/O capabilities.",
"keywords": [
"openPMD",
"Open Science",
"Open Data",
"HDF5",
"ADIOS",
"data",
"MPI",
"HPC",
"research",
"file-format",
"file-handling"
],
"notes": "Supported by the Exascale Computing Project (17-SC-20-SC), a collaborative effort of two U.S. Department of Energy organizations (Office of Science and the National Nuclear Security Administration). Supported by the Consortium for Advanced Modeling of Particles Accelerators (CAMPA), funded by the U.S. DOE Office of Science under Contract No. DE-AC02-05CH11231. This work was partially funded by the Center of Advanced Systems Understanding (CASUS), which is financed by Germany's Federal Ministry of Education and Research (BMBF) and by the Saxon Ministry for Science, Culture and Tourism (SMWK) with tax funds on the basis of the budget approved by the Saxon State Parliament.",
"grants": [
{
"id": "654220"
}
],
"related_identifiers": [
{
"identifier": "DOI:10.5281/zenodo.1167843",
"relation": "isCitedBy"
},
{
"identifier": "DOI:10.5281/zenodo.1069534",
"relation": "isCitedBy"
},
{
"identifier": "DOI:10.5281/zenodo.33624",
"relation": "isCitedBy"
}
]
],
"contributors": [
{
"affiliation": "EU XFEL GmbH",
"name": "Fortmann-Grote, Carsten",
"orcid": "0000-0002-2579-5546",
"type": "Other"
},
{
"affiliation": "Warsaw University of Technology",
"name": "Stańczak, Dominik",
"orcid": "0000-0001-6291-8843",
"type": "Other"
},
{
"affiliation": "Fermi National Accelerator Laboratory",
"name": "Amundson, James",
"orcid": "0000-0001-6918-2728",
"type": "Other"
},
{
"affiliation": "Anaconda, Inc.",
"name": "Donnelly, Ray",
"type": "Other"
},
{
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"name": "Widera, René",
"orcid": "0000-0003-1642-0459",
"type": "Other"
},
{
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"name": "Zenker, Erik",
"orcid": "0000-0001-9417-8712",
"type": "Other"
},
{
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"name": "Bastrakov, Sergei",
"orcid": "0000-0003-3396-6154",
"type": "Other"
},
{
"affiliation": "Lawrence Berkeley National Laboratory",
"name": "Lehe, Rémi",
"orcid": "0000-0002-3656-9659",
"type": "Other"
},
{
"affiliation": "Lawrence Berkeley National Laboratory",
"name": "Amorim, Lígia Diana",
"orcid": "0000-0002-1445-0032",
"type": "Other"
},
{
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"name": "Bastrakova, Kseniia",
"type": "Other"
},
{
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"name": "Pausch, Richard",
"orcid": "0000-0001-7990-9564",
"type": "Other"
},
{
"affiliation": "Helmholtz-Zentrum Dresden-Rossendorf",
"name": "Ordyna, Paweł",
"type": "Other"
},
{
"affiliation": "Oak Ridge National Laboratory",
"name": "Ganyushin, Dmitry",
"orcid": "0000-0001-7337-2161",
"type": "Other"
},
{
"affiliation": "NVIDIA",
"name": "Kirkham, John",
"type": "Other"
},
{
"affiliation": "Perimeter Institute for Theoretical Physics",
"name": "Schnetter, Erik",
"orcid": "0000-0002-4518-9017",
"type": "Other"
},
{
"affiliation": "Lawrence Berkeley National Laboratory",
"name": "Bez, Jean Luca",
"orcid": "0000-0002-3915-1135",
"type": "Other"
}
],
"title": "C++ & Python API for Scientific I/O with openPMD",
"access_right": "open",
"upload_type": "software",
"license": "LGPL-3.0",
"pub_id": "27579",
"description": "openPMD is an open metadata format for open data workflows in open science. This library provides a common high-level API for openPMD writing and reading. It provides a common interface to I/O libraries and file formats such as HDF5 and ADIOS. Where supported, openPMD-api implements both serial and MPI parallel I/O capabilities.",
"keywords": [
"openPMD",
"Open Science",
"Open Data",
"HDF5",
"ADIOS",
"data",
"MPI",
"HPC",
"research",
"file-format",
"file-handling"
],
"notes": "Supported by the Exascale Computing Project (17-SC-20-SC), a collaborative effort of two U.S. Department of Energy organizations (Office of Science and the National Nuclear Security Administration). Supported by the Consortium for Advanced Modeling of Particles Accelerators (CAMPA), funded by the U.S. DOE Office of Science under Contract No. DE-AC02-05CH11231. This work was partially funded by the Center of Advanced Systems Understanding (CASUS), which is financed by Germany's Federal Ministry of Education and Research (BMBF) and by the Saxon Ministry for Science, Culture and Tourism (SMWK) with tax funds on the basis of the budget approved by the Saxon State Parliament.",
"grants": [
{
"id": "654220"
}
],
"related_identifiers": [
{
"identifier": "DOI:10.5281/zenodo.1167843",
"relation": "isCitedBy"
},
{
"identifier": "DOI:10.5281/zenodo.1069534",
"relation": "isCitedBy"
},
{
"identifier": "DOI:10.5281/zenodo.33624",
"relation": "isCitedBy"
}
]
}
4 changes: 2 additions & 2 deletions docs/source/details/adios2.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
{
"type": "blosc",
"parameters": {
"clevel": "1",
"doshuffle": "BLOSC_BITSHUFFLE"
"clevel": "1",
"doshuffle": "BLOSC_BITSHUFFLE"
}
}
]
Expand Down
8 changes: 4 additions & 4 deletions docs/source/details/config_layout.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"adios1": "put ADIOS config here",
"adios2": "put ADIOS2 config here",
"hdf5": "put HDF5 config here",
"json": "put JSON config here"
"adios1": "put ADIOS config here",
"adios2": "put ADIOS2 config here",
"hdf5": "put HDF5 config here",
"json": "put JSON config here"
}

0 comments on commit eec3f06

Please sign in to comment.