Skip to content

Commit

Permalink
Lint script link broken, also lint filter was broken for generated py…
Browse files Browse the repository at this point in the history
… files (#4133)
  • Loading branch information
ericl authored and pcmoritz committed Feb 23, 2019
1 parent 9896df7 commit f1239a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions ci/travis/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,20 @@ format_changed() {
# exist on both branches.
MERGEBASE="$(git merge-base upstream/master HEAD)"

if ! git diff --diff-filter=ACM --quiet --exit-code "$MERGEBASE" -- '*.p*' &>/dev/null; then
if ! git diff --diff-filter=ACM --quiet --exit-code "$MERGEBASE" -- '*.py' &>/dev/null; then
git diff --name-only --diff-filter=ACM "$MERGEBASE" -- '*.py' | xargs -P 5 \
yapf --in-place "${YAPF_EXCLUDES[@]}" "${YAPF_FLAGS[@]}"
if which flake8 >/dev/null; then
git diff --name-only --diff-filter=ACM "$MERGEBASE" -- '*.py' | xargs -P 5 \
flake8 --exclude=python/ray/core/generated/,doc/source/conf.py,python/ray/cloudpickle/ \
--ignore=C408,E121,E123,E126,E226,E24,E704,W503,W504,W605
git diff --name-only --diff-filter=ACM "$MERGEBASE" -- '*.p*' | xargs -P 5 \
flake8 --filename="*.pyx,*.pxd,*.pxi" --ignore=E211,E225,E226,E227,E999
fi
fi

if ! git diff --diff-filter=ACM --quiet --exit-code "$MERGEBASE" -- '*.pyx' '*.pxd' '*.pxi' &>/dev/null; then
if which flake8 >/dev/null; then
git diff --name-only --diff-filter=ACM "$MERGEBASE" -- '*.pyx' '*.pxd' '*.pxi' | xargs -P 5 \
flake8 --ignore=E211,E225,E226,E227,E999
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion scripts

0 comments on commit f1239a7

Please sign in to comment.