From 7ea7fc8d38c7334a191f5c3fe718b88c27580d6a Mon Sep 17 00:00:00 2001 From: cdce8p <30130371+cdce8p@users.noreply.github.com> Date: Sat, 10 Mar 2018 18:12:23 +0100 Subject: [PATCH] Script/lint, Lazytox: Fix issue to ignore delete files (#13051) * Fix issue to ignore delete files * Updated lazytox --- script/lazytox.py | 4 +++- script/lint | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/script/lazytox.py b/script/lazytox.py index 2137ae1794c..7c57b49c00d 100755 --- a/script/lazytox.py +++ b/script/lazytox.py @@ -127,6 +127,7 @@ async def flake8(files): async def lint(files): """Perform lint.""" + files = [file for file in files if os.path.isfile(file)] fres, pres = await asyncio.gather(flake8(files), pylint(files)) res = fres + pres @@ -182,7 +183,8 @@ async def main(): gen_req = True # requirements script for components # Find test files... if fname.startswith('tests/'): - if '/test_' in fname: # All test helpers should be excluded + if '/test_' in fname and os.path.isfile(fname): + # All test helpers should be excluded test_files.add(fname) else: parts = fname.split('/') diff --git a/script/lint b/script/lint index 9d994429f74..44871dbc9a4 100755 --- a/script/lint +++ b/script/lint @@ -3,9 +3,9 @@ cd "$(dirname "$0")/.." -export files="`git diff upstream/dev... --name-only | grep -e '\.py$'`" +export files="`git diff upstream/dev... --diff-filter=d --name-only | grep -e '\.py$'`" echo "=================================================" -echo "FILES CHANGED (git diff upstream/dev... --name-only)" +echo "FILES CHANGED (git diff upstream/dev... --diff-filter=d --name-only)" echo "=================================================" if [ -z "$files" ] ; then echo "No python file changed. Rather use: tox -e lint"