From eec3f0617335828a84d793c4525a18577f7c66b6 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Tue, 8 Mar 2022 10:17:57 -0800 Subject: [PATCH] Clang-Format 13: JSON (#1222) * 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> --- .clang-format | 6 + .../workflows/clang-format/clang-format.sh | 4 +- .pre-commit-config.yaml | 3 +- .rodare.json | 310 +++++++++--------- docs/source/details/adios2.json | 4 +- docs/source/details/config_layout.json | 8 +- 6 files changed, 171 insertions(+), 164 deletions(-) diff --git a/.clang-format b/.clang-format index c47a8364e6..afc8312d97 100644 --- a/.clang-format +++ b/.clang-format @@ -1,3 +1,4 @@ +--- Language: Cpp BasedOnStyle: LLVM @@ -64,3 +65,8 @@ SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Auto StatementMacros: ["OPENPMD_private", "OPENPMD_protected"] + +--- +Language: Json +BasedOnStyle: llvm +... diff --git a/.github/workflows/clang-format/clang-format.sh b/.github/workflows/clang-format/clang-format.sh index 863b68ba67..0b99c629ab 100755 --- a/.github/workflows/clang-format/clang-format.sh +++ b/.github/workflows/clang-format/clang-format.sh @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e15ddbc1d..c36ffc186a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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 diff --git a/.rodare.json b/.rodare.json index 63c816bb3d..f2324fc670 100644 --- a/.rodare.json +++ b/.rodare.json @@ -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" + } + ] } diff --git a/docs/source/details/adios2.json b/docs/source/details/adios2.json index 456c83707b..d71061c0bc 100644 --- a/docs/source/details/adios2.json +++ b/docs/source/details/adios2.json @@ -12,8 +12,8 @@ { "type": "blosc", "parameters": { - "clevel": "1", - "doshuffle": "BLOSC_BITSHUFFLE" + "clevel": "1", + "doshuffle": "BLOSC_BITSHUFFLE" } } ] diff --git a/docs/source/details/config_layout.json b/docs/source/details/config_layout.json index 8960916860..382060f364 100644 --- a/docs/source/details/config_layout.json +++ b/docs/source/details/config_layout.json @@ -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" }