Skip to content

Commit 486ec51

Browse files
committed
Add support for ignoring failed files
1 parent 9bc4812 commit 486ec51

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

tools/make/lib/lint/r/Makefile

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,19 @@ lint-r: lint-r-src lint-r-tests-fixtures lint-r-examples lint-r-benchmarks
4141
# This target lints only R source files.
4242

4343
lint-r-src:
44+
ifeq ($(FAIL_FAST), true)
4445
$(QUIET) $(FIND_R_SOURCES_CMD) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r file; do \
4546
echo ''; \
4647
echo "Linting file: $$file"; \
4748
$(R_LINTER) $(R_LINTER_FLAGS) $$file || exit 1; \
4849
done
50+
else
51+
$(QUIET) $(FIND_R_SOURCES_CMD) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r file; do \
52+
echo ''; \
53+
echo "Linting file: $$file"; \
54+
$(R_LINTER) $(R_LINTER_FLAGS) $$file; \
55+
done
56+
endif
4957

5058
.PHONY: lint-r-src
5159

@@ -55,11 +63,19 @@ lint-r-src:
5563
# This target lints only R test fixture files.
5664

5765
lint-r-tests-fixtures:
66+
ifeq ($(FAIL_FAST), true)
5867
$(QUIET) $(FIND_R_TESTS_FIXTURES_CMD) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r file; do \
5968
echo ''; \
6069
echo "Linting file: $$file"; \
6170
$(R_LINTER) $(R_LINTER_FLAGS) $$file || exit 1; \
6271
done
72+
else
73+
$(QUIET) $(FIND_R_TESTS_FIXTURES_CMD) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r file; do \
74+
echo ''; \
75+
echo "Linting file: $$file"; \
76+
$(R_LINTER) $(R_LINTER_FLAGS) $$file; \
77+
done
78+
endif
6379

6480
.PHONY: lint-r-tests-fixtures
6581

@@ -69,11 +85,19 @@ lint-r-tests-fixtures:
6985
# This target lints only R example files.
7086

7187
lint-r-examples:
88+
ifeq ($(FAIL_FAST), true)
7289
$(QUIET) $(FIND_R_EXAMPLES_CMD) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r file; do \
7390
echo ''; \
7491
echo "Linting file: $$file"; \
7592
$(R_LINTER) $(R_LINTER_FLAGS) $$file || exit 1; \
7693
done
94+
else
95+
$(QUIET) $(FIND_R_EXAMPLES_CMD) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r file; do \
96+
echo ''; \
97+
echo "Linting file: $$file"; \
98+
$(R_LINTER) $(R_LINTER_FLAGS) $$file; \
99+
done
100+
endif
77101

78102
.PHONY: lint-r-examples
79103

@@ -83,11 +107,19 @@ lint-r-examples:
83107
# This target lints only R benchmark files.
84108

85109
lint-r-benchmarks:
110+
ifeq ($(FAIL_FAST), true)
86111
$(QUIET) $(FIND_R_BENCHMARKS_CMD) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r file; do \
87112
echo ''; \
88113
echo "Linting file: $$file"; \
89114
$(R_LINTER) $(R_LINTER_FLAGS) $$file || exit 1; \
90115
done
116+
else
117+
$(QUIET) $(FIND_R_BENCHMARKS_CMD) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r file; do \
118+
echo ''; \
119+
echo "Linting file: $$file"; \
120+
$(R_LINTER) $(R_LINTER_FLAGS) $$file; \
121+
done
122+
endif
91123

92124
.PHONY: lint-r-benchmarks
93125

@@ -97,11 +129,18 @@ lint-r-benchmarks:
97129
# This target lints R files. Note that we expect `$FILES` to be a R file list.
98130

99131
lint-r-files:
132+
ifeq ($(FAIL_FAST), true)
100133
$(QUIET) for file in $(FILES); do \
101134
echo ''; \
102135
echo "Linting file: $$file"; \
103136
$(R_LINTER) $(R_LINTER_FLAGS) $$file || exit 1; \
104137
done
138+
else
139+
$(QUIET) for file in $(FILES); do \
140+
echo ''; \
141+
echo "Linting file: $$file"; \
142+
$(R_LINTER) $(R_LINTER_FLAGS) $$file; \
143+
done
144+
endif
105145

106146
.PHONY: lint-r-files
107-

0 commit comments

Comments
 (0)