From e6256446ddef5c5d5240eefff974556f2e12ac46 Mon Sep 17 00:00:00 2001 From: Benjamin Bannier Date: Tue, 10 Oct 2023 21:30:14 +0200 Subject: [PATCH] Format JSON with clang-format We do not activate support for JavaScript at this time since most of our JavaScript code is in BTest files to test zeekjs, but these files also contain other languages which leads to largely misformated files. --- .clang-format | 2 + .cmake-format.json | 170 ++++++++++++++++++++-------------------- .pre-commit-config.yaml | 1 + 3 files changed, 88 insertions(+), 85 deletions(-) diff --git a/.clang-format b/.clang-format index d32dc20b13..b652ea6568 100644 --- a/.clang-format +++ b/.clang-format @@ -141,4 +141,6 @@ StatementMacros: - STANDARD_OPERATOR_1 TabWidth: 4 UseTab: Never +--- +Language: Json ... diff --git a/.cmake-format.json b/.cmake-format.json index cb071ca269..5682845d29 100644 --- a/.cmake-format.json +++ b/.cmake-format.json @@ -1,88 +1,88 @@ { - "parse": { - "additional_commands": { - "CheckIPProto": { - "kwargs": { - "_proto": "*" - } - }, - "CheckType": { - "kwargs": { - "_type": "*", - "_alt_type": "*", - "_var": "*" - } - }, - "SetPackageVersion": { - "kwargs": { - "_version": "*" - } - }, - "SetPackageFileName": { - "kwargs": { - "_version": "*" - } - }, - "SetPackageInstallScripts": { - "kwargs": { - "VERSION": "*" - } - }, - "ConfigurePackaging": { - "kwargs": { - "_version": "*" - } - }, - "SetPackageGenerators": {}, - "SetPackageMetadata": {}, - "FindRequiredPackage": { - "kwargs": { - "packageName": "*" - } - }, - "InstallClobberImmune": { - "kwargs": { - "_srcfile": "*", - "_dstfile": "*" - } - }, - "InstallPackageConfigFile": { - "kwargs": { - "_srcfile": "*", - "_dstdir": "*", - "_dstfilename": "*" - } - }, - "InstallShellScript": { - "kwargs": { - "_srcfile": "*", - "_dstfile": "*" - } - }, - "InstallSymLink": { - "kwargs": { - "_filepath": "*", - "_sympath": "*" - } - }, - "spicy_add_analyzer": { - "kwargs": { - "NAME": "*", - "PACKAGE_NAME": "*", - "SOURCES": "*", - "MODULES": "*" - } - } - } - }, - "format": { - "line_width": 100, - "tab_size": 4, - "separate_ctrl_name_with_space": true, - "max_subgroups_hwrap": 3, - "line_ending": "unix" - }, - "markup": { - "enable_markup": false + "parse": { + "additional_commands": { + "CheckIPProto": { + "kwargs": { + "_proto": "*" + } + }, + "CheckType": { + "kwargs": { + "_type": "*", + "_alt_type": "*", + "_var": "*" + } + }, + "SetPackageVersion": { + "kwargs": { + "_version": "*" + } + }, + "SetPackageFileName": { + "kwargs": { + "_version": "*" + } + }, + "SetPackageInstallScripts": { + "kwargs": { + "VERSION": "*" + } + }, + "ConfigurePackaging": { + "kwargs": { + "_version": "*" + } + }, + "SetPackageGenerators": {}, + "SetPackageMetadata": {}, + "FindRequiredPackage": { + "kwargs": { + "packageName": "*" + } + }, + "InstallClobberImmune": { + "kwargs": { + "_srcfile": "*", + "_dstfile": "*" + } + }, + "InstallPackageConfigFile": { + "kwargs": { + "_srcfile": "*", + "_dstdir": "*", + "_dstfilename": "*" + } + }, + "InstallShellScript": { + "kwargs": { + "_srcfile": "*", + "_dstfile": "*" + } + }, + "InstallSymLink": { + "kwargs": { + "_filepath": "*", + "_sympath": "*" + } + }, + "spicy_add_analyzer": { + "kwargs": { + "NAME": "*", + "PACKAGE_NAME": "*", + "SOURCES": "*", + "MODULES": "*" + } + } } + }, + "format": { + "line_width": 100, + "tab_size": 4, + "separate_ctrl_name_with_space": true, + "max_subgroups_hwrap": 3, + "line_ending": "unix" + }, + "markup": { + "enable_markup": false + } } diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 203773b63a..c0eeaf567e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,6 +9,7 @@ repos: types_or: - "c" - "c++" + - "json" - repo: https://github.com/maxwinterstein/shfmt-py rev: v3.7.0.1