[go: nahoru, domu]

Skip to content

Commit

Permalink
Ignore bad-whitespace, but only for keyword argument assignment.
Browse files Browse the repository at this point in the history
Old versions of pylint don't properly handle typed keyword args, which PEP mandates should have a space between the type and the assignment for the default value.

Also ignore invalid-sequence-index errors, which misfire on the parameterization of Dict with str keys. Presumably any real invalid sequence indexing should be caught by trivial unit tests.

PiperOrigin-RevId: 332136188
Change-Id: I8edc23f061dccc18d68afe246aa71d5f98d61cd0
  • Loading branch information
Revan Sopher authored and tensorflower-gardener committed Sep 17, 2020
1 parent a0d6054 commit d9ae2b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tensorflow/tools/ci_build/ci_sanity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ do_pylint() {
"^tensorflow/python/kernel_tests/constant_op_eager_test.py.*\[E0303.*invalid-length-returned "\
"^tensorflow/python/keras/utils/data_utils.py.*\[E1102.*not-callable "\
"^tensorflow/python/autograph/.*_py3_test\.py.*\[E0001.*syntax-error "\
"^tensorflow/python/keras/preprocessing/image\.py.*\[E0240.*Inconsistent method resolution "
"^tensorflow/python/keras/preprocessing/image\.py.*\[E0240.*Inconsistent method resolution "\
"^tensorflow/\.py.*\[C0326.*bad-whitespace.*No space allowed around keyword argument assignment "

echo "ERROR_ALLOWLIST=\"${ERROR_ALLOWLIST}\""

Expand Down Expand Up @@ -215,7 +216,7 @@ do_pylint() {
IS_ALLOWLISTED=0
for WL_REGEX in ${ERROR_ALLOWLIST}; do
if echo ${LINE} | grep -q "${WL_REGEX}"; then
echo "Found a allowlisted error:"
echo "Found an allowlisted error:"
echo " ${LINE}"
IS_ALLOWLISTED=1
fi
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/tools/ci_build/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ enable=indexing-exception,old-raise-syntax
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=design,similarities,no-self-use,attribute-defined-outside-init,locally-disabled,star-args,pointless-except,bad-option-value,global-statement,fixme,suppressed-message,useless-suppression,locally-enabled,no-member,no-name-in-module,import-error,unsubscriptable-object,unbalanced-tuple-unpacking,undefined-variable,not-context-manager
disable=design,similarities,no-self-use,attribute-defined-outside-init,locally-disabled,star-args,pointless-except,bad-option-value,global-statement,fixme,suppressed-message,useless-suppression,locally-enabled,no-member,no-name-in-module,import-error,unsubscriptable-object,unbalanced-tuple-unpacking,undefined-variable,not-context-manager,invalid-sequence-index


# Set the cache size for astng objects.
Expand Down

0 comments on commit d9ae2b7

Please sign in to comment.