Skip to content

Commit c89429a

Browse files
thomasvlallevato
authored andcommitted
Make sure the scripts continue after reporting lint issues.
PiperOrigin-RevId: 225539202
1 parent d9681e5 commit c89429a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.travis/build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,18 @@ if [[ -n "${BUILDIFER:-}" ]]; then
9595

9696
# Check for lint issues?
9797
if [[ "${LINT:-yes}" == "yes" ]] ; then
98+
# NOTE: buildifier defaults to --mode=fix, so these lint runs also
99+
# reformat the files. But since this is on travis, that is fine.
100+
# https://github.com/bazelbuild/buildtools/issues/453
98101
if ! find . "${FIND_ARGS[@]}" -print | xargs buildifier --lint=warn > /dev/null 2>&1 ; then
99102
if [[ "${FOUND_ISSUES}" != "no" ]] ; then
100103
echo ""
101104
fi
102105
echo "ERROR: BUILD/.bzl lint issue(s):"
103106
echo ""
104-
find . "${FIND_ARGS[@]}" -print | xargs buildifier --lint=warn
107+
# buildifier now exist with error if there are issues, so use `|| true`
108+
# to keep the script running.
109+
find . "${FIND_ARGS[@]}" -print | xargs buildifier --lint=warn || true
105110
echo ""
106111
echo "Please download the latest buildifier"
107112
echo " https://github.com/bazelbuild/buildtools/releases"

0 commit comments

Comments
 (0)