Skip to content

Commit

Permalink
Use xargs' -P 0 option in JSON style check (CleverRaven#50098)
Browse files Browse the repository at this point in the history
* use -P 0 option on JSON style check
* xargs' -P 0 option to JSON style doc
  • Loading branch information
casswedson authored Jul 21, 2021
1 parent c7ef953 commit fb6455f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions doc/JSON_STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fb6455f

Please sign in to comment.