Skip to content

Commit 4527652

Browse files
committed
Add PPFILES flag to specify a which files to reformat
Accepts a path with wildcards
1 parent 278d360 commit 4527652

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

mk/pp.mk

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
# Create a way to reformat just some files
2+
ifdef PPFILES
3+
PP_INPUTS_FILTERED := $(wildcard $(PPFILES))
4+
else
5+
PP_INPUTS = $(wildcard $(addprefix $(S)src/lib/,*.rs */*.rs)) \
6+
$(wildcard $(addprefix $(S)src/comp/,*.rs */*.rs */*/*.rs)) \
7+
$(wildcard $(S)src/test/*/*.rs \
8+
$(S)src/test/*/*/*.rs) \
9+
$(wildcard $(S)src/fuzzer/*.rs)
110

2-
PP_INPUTS = $(wildcard $(addprefix $(S)src/lib/,*.rs */*.rs)) \
3-
$(wildcard $(addprefix $(S)src/comp/,*.rs */*.rs */*/*.rs)) \
4-
$(wildcard $(S)src/test/*/*.rs \
5-
$(S)src/test/*/*/*.rs) \
6-
$(wildcard $(S)src/fuzzer/*.rs)
7-
8-
PP_INPUTS_FILTERED = $(shell echo $(PP_INPUTS) | xargs grep -L no-reformat)
11+
PP_INPUTS_FILTERED = $(shell echo $(PP_INPUTS) | xargs grep -L no-reformat)
12+
endif
913

1014
reformat: $(SREQ1)
1115
@$(call E, reformat [stage1]: $@)

0 commit comments

Comments
 (0)