Commit a7af3ef4 by Marcus Shawcroft Committed by Tianqi Chen

[LINT] Improve robustness in task_lint.sh logic (#3315)

The existing RAT ASF license auditing logic ignores any failure in the
shell pipeline rather than just the exit code of the final grep.
Adjust the logic such that failure of the various tools in the
pipeline are not elided away.
parent ef142577
...@@ -31,7 +31,7 @@ echo "Check file types..." ...@@ -31,7 +31,7 @@ echo "Check file types..."
python3 tests/lint/check_file_type.py python3 tests/lint/check_file_type.py
echo "Check ASF license header..." echo "Check ASF license header..."
java -jar /bin/apache-rat.jar -E tests/lint/rat-excludes -d . |grep "== File" > /tmp/$$.apache-rat.txt || true java -jar /bin/apache-rat.jar -E tests/lint/rat-excludes -d . | (grep "== File" > /tmp/$$.apache-rat.txt || true)
if grep --quiet -E "File" /tmp/$$.apache-rat.txt; then if grep --quiet -E "File" /tmp/$$.apache-rat.txt; then
echo "Need to add ASF header to the following files." echo "Need to add ASF header to the following files."
echo "----------------File List----------------" echo "----------------File List----------------"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment