Script/lint, Lazytox: Fix issue to ignore delete files (#13051)
* Fix issue to ignore delete files * Updated lazytox
This commit is contained in:
parent
86baed4e52
commit
7ea7fc8d38
2 changed files with 5 additions and 3 deletions
|
@ -127,6 +127,7 @@ async def flake8(files):
|
||||||
|
|
||||||
async def lint(files):
|
async def lint(files):
|
||||||
"""Perform lint."""
|
"""Perform lint."""
|
||||||
|
files = [file for file in files if os.path.isfile(file)]
|
||||||
fres, pres = await asyncio.gather(flake8(files), pylint(files))
|
fres, pres = await asyncio.gather(flake8(files), pylint(files))
|
||||||
|
|
||||||
res = fres + pres
|
res = fres + pres
|
||||||
|
@ -182,7 +183,8 @@ async def main():
|
||||||
gen_req = True # requirements script for components
|
gen_req = True # requirements script for components
|
||||||
# Find test files...
|
# Find test files...
|
||||||
if fname.startswith('tests/'):
|
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)
|
test_files.add(fname)
|
||||||
else:
|
else:
|
||||||
parts = fname.split('/')
|
parts = fname.split('/')
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
|
|
||||||
cd "$(dirname "$0")/.."
|
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 "================================================="
|
||||||
echo "FILES CHANGED (git diff upstream/dev... --name-only)"
|
echo "FILES CHANGED (git diff upstream/dev... --diff-filter=d --name-only)"
|
||||||
echo "================================================="
|
echo "================================================="
|
||||||
if [ -z "$files" ] ; then
|
if [ -z "$files" ] ; then
|
||||||
echo "No python file changed. Rather use: tox -e lint"
|
echo "No python file changed. Rather use: tox -e lint"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue