From fb6455faff529fc9502f0e36d52f3f8282c34572 Mon Sep 17 00:00:00 2001 From: casswedson <58050969+casswedson@users.noreply.github.com> Date: Wed, 21 Jul 2021 01:19:52 -0500 Subject: [PATCH] Use xargs' -P 0 option in JSON style check (#50098) * use -P 0 option on JSON style check * xargs' -P 0 option to JSON style doc --- Makefile | 2 +- doc/JSON_STYLE.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9174e266b18d5..86e306648270b 100644 --- a/Makefile +++ b/Makefile @@ -1206,7 +1206,7 @@ endif style-json: json_blacklist $(JSON_FORMATTER_BIN) ifndef CROSS find data gfx -name "*.json" -print0 | grep -v -z -F -f json_blacklist | \ - xargs -0 -L 1 $(JSON_FORMATTER_BIN) + xargs -P 0 -0 -L 1 $(JSON_FORMATTER_BIN) else @echo Cannot run json formatter in cross compiles. endif diff --git a/doc/JSON_STYLE.md b/doc/JSON_STYLE.md index 97bac4a61e586..6186937f203fe 100644 --- a/doc/JSON_STYLE.md +++ b/doc/JSON_STYLE.md @@ -49,13 +49,13 @@ The formatting tool can be found alongside the releases as `json_formatter.exe` Using `make style-json` will format all files included in the JSON validation test, alternatively: ```sh # Using git to filter JSON files with uncommitted changes (provided there are no spaces in the file or directory names). -git diff --name-only '*.json' | xargs -L 1 json_formatter +git diff --name-only '*.json' | xargs -P 0 -L 1 json_formatter # Using git to filter modified JSON files in the current branch. -git diff master --name-only '*.json' | xargs -L 1 json_formatter +git diff master --name-only '*.json' | xargs -P 0 -L 1 json_formatter # Per-folder formatting. -find path/to/desired/folder -name "*.json" -print0 | xargs -0 -L 1 json_formatter +find path/to/desired/folder -name "*.json" -print0 | xargs -P 0 -0 -L 1 json_formatter ``` --- If you're using the Visual Studio solution, you can configure Visual Studio with