Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More granular json-style and astyle #51731

Merged
merged 4 commits into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1149,8 +1149,10 @@ etags: $(ASTYLE_SOURCES)
etags $^
./tools/json_tools/cddatags.py

astyle: $(ASTYLE_SOURCES)
$(ASTYLE_BINARY) --options=.astylerc -n $(ASTYLE_SOURCES)
ASTYLE_CHECK_STAMPS = $(sort $(patsubst %,$(ODIR)/%.astyle-check-stamp,$(ASTYLE_SOURCES)))
astyle : $(ASTYLE_CHECK_STAMPS)
$(ASTYLE_CHECK_STAMPS) : $(ODIR)/%.astyle-check-stamp : %
$(ASTYLE_BINARY) --options=.astylerc $< && mkdir -p $(@D) && touch $@
kevingranade marked this conversation as resolved.
Show resolved Hide resolved

# Test whether the system has a version of astyle that supports --dry-run
ifeq ($(shell if $(ASTYLE_BINARY) -Q -X --dry-run src/game.h > /dev/null; then echo foo; fi),foo)
Expand All @@ -1166,12 +1168,14 @@ else
@echo Cannot run an astyle check, your system either does not have astyle, or it is too old.
endif

style-json: json_blacklist $(JSON_FORMATTER_BIN)
JSON_SOURCES := $(shell find data -name "*.json")
JSON_CHECK_STAMPS = $(sort $(patsubst %,$(ODIR)/%,$(JSON_SOURCES:.json=.jstyle-check-stamp)))
style-json : $(JSON_CHECK_STAMPS)
kevingranade marked this conversation as resolved.
Show resolved Hide resolved
$(JSON_CHECK_STAMPS) : $(ODIR)/%.jstyle-check-stamp : %.json
kevingranade marked this conversation as resolved.
Show resolved Hide resolved
ifndef CROSS
find data gfx -name "*.json" -print0 | grep -v -z -F -f json_blacklist | \
xargs -0 -L 1 $(JSON_FORMATTER_BIN)
$(JSON_FORMATTER_BIN) $< && mkdir -p $(@D) && touch $@
else
@echo Cannot run json formatter in cross compiles.
@echo Cannot run json formatter in cross compiles.
kevingranade marked this conversation as resolved.
Show resolved Hide resolved
endif

style-all-json: $(JSON_FORMATTER_BIN)
Expand Down
1 change: 0 additions & 1 deletion json_blacklist

This file was deleted.