diff --git a/script/lazytox.py b/script/lazytox.py index 7c57b49c00d..2639d640753 100755 --- a/script/lazytox.py +++ b/script/lazytox.py @@ -94,7 +94,9 @@ async def git(): """Exec git.""" if len(sys.argv) > 2 and sys.argv[1] == '--': return sys.argv[2:] - _, log = await async_exec('git', 'diff', 'upstream/dev...', '--name-only') + _, log = await async_exec('git', 'merge-base', 'upstream/dev', 'HEAD') + merge_base = log.splitlines()[0] + _, log = await async_exec('git', 'diff', merge_base, '--name-only') return log.splitlines() diff --git a/script/lint b/script/lint index 44871dbc9a4..dc6884f4882 100755 --- a/script/lint +++ b/script/lint @@ -3,10 +3,10 @@ cd "$(dirname "$0")/.." -export files="`git diff upstream/dev... --diff-filter=d --name-only | grep -e '\.py$'`" -echo "=================================================" -echo "FILES CHANGED (git diff upstream/dev... --diff-filter=d --name-only)" -echo "=================================================" +export files="$(git diff $(git merge-base upstream/dev HEAD) --diff-filter=d --name-only | grep -e '\.py$')" +echo '=================================================' +echo '= FILES CHANGED =' +echo '=================================================' if [ -z "$files" ] ; then echo "No python file changed. Rather use: tox -e lint" exit @@ -19,5 +19,5 @@ flake8 --doctests $files echo "================" echo "LINT with pylint" echo "================" -pylint $files +pylint $(echo "$files" | grep -v '^tests.*') echo