Skip to content

Commit eb9969f

Browse files
committed
Add support for marking files no-reformat.
1 parent 050f629 commit eb9969f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

mk/pp.mk

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@ PP_INPUTS := $(wildcard $(addprefix $(S)src/lib/,*.rs */*.rs)) \
44
$(wildcard $(S)src/test/*/*.rs \
55
$(S)src/test/*/*/*.rs)
66

7+
PP_INPUTS_FILTERED = $(shell echo $(PP_INPUTS) | xargs grep -L no-reformat)
8+
79
reformat: $(SREQ1)
810
@$(call E, reformat [stage1]: $@)
9-
for i in $(PP_INPUTS); \
11+
for i in $(PP_INPUTS_FILTERED); \
1012
do $(call CFG_RUN_TARG,stage1, stage1/rustc$(X)) \
11-
--pretty normal $$i >$$i.tmp && mv $$i.tmp $$i; \
13+
--pretty normal $$i >$$i.tmp; \
14+
if cmp --silent $$i.tmp $$i; \
15+
then echo no changes to $$i; rm $$i.tmp; \
16+
else mv $$i.tmp $$i; fi \
1217
done

src/test/run-pass/block-expr-precedence.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// no-reformat
2+
13
/*
24
*
35
* When you write a block-expression thing followed by

0 commit comments

Comments
 (0)