Unverified Commit 609260cd authored by Hongkun Yu's avatar Hongkun Yu Committed by GitHub
Browse files

Update lint presubmit to be consistent with tensorflow (#7278)

Only care about errors and output into an error file.
parent 1fc839bc
...@@ -78,6 +78,18 @@ do_pylint() { ...@@ -78,6 +78,18 @@ do_pylint() {
echo "pylint took $((PYLINT_END_TIME - PYLINT_START_TIME)) s" echo "pylint took $((PYLINT_END_TIME - PYLINT_START_TIME)) s"
echo "" echo ""
# Report only what we care about
# Ref https://pylint.readthedocs.io/en/latest/technical_reference/features.html
# E: all errors
# W0311 bad-indentation
# W0312 mixed-indentation
# C0330 bad-continuation
# C0301 line-too-long
# C0326 bad-whitespace
# W0611 unused-import
# W0622 redefined-builtin
grep -E '(\[E|\[W0311|\[W0312|\[C0330|\[C0301|\[C0326|\[W0611|\[W0622)' ${OUTPUT_FILE} > ${ERRORS_FILE}
N_ERRORS=0 N_ERRORS=0
while read -r LINE; do while read -r LINE; do
IS_WHITELISTED=0 IS_WHITELISTED=0
...@@ -94,7 +106,9 @@ do_pylint() { ...@@ -94,7 +106,9 @@ do_pylint() {
echo "" >> ${NONWL_ERRORS_FILE} echo "" >> ${NONWL_ERRORS_FILE}
((N_ERRORS++)) ((N_ERRORS++))
fi fi
done <${OUTPUT_FILE} done <${ERRORS_FILE}
echo "Raw lint output file: ${OUTPUT_FILE}"
echo "" echo ""
if [[ ${N_ERRORS} != 0 ]]; then if [[ ${N_ERRORS} != 0 ]]; then
......
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