From ac7627a9486474092a859189cf7e9181d627b6b1 Mon Sep 17 00:00:00 2001 From: coffeedogs Date: Thu, 10 May 2018 16:09:10 +0100 Subject: [PATCH] Fixed: sorting bug --- fabfile/tasks.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fabfile/tasks.py b/fabfile/tasks.py index 46008797..a0a09ec4 100644 --- a/fabfile/tasks.py +++ b/fabfile/tasks.py @@ -112,7 +112,7 @@ def code_quality(top=10, verbose=True, details=False, fix=False, filename=None): fix = coerce_bool(fix) end = int(top) if int(top) else -1 - with hide('warnings', 'running'): # pylint: disable=not-context-manager + with hide('warnings', 'running', 'stdout'): # pylint: disable=not-context-manager with virtualenv(VENV_ROOT): if filename: filename = os.path.abspath(filename) @@ -123,7 +123,10 @@ def code_quality(top=10, verbose=True, details=False, fix=False, filename=None): file_list = [filename] else: with cd(PROJECT_ROOT): # pylint: disable=not-context-manager - file_list = run('find . -name "*.py"').split("\n") + file_list = [ + os.path.abspath(i.rstrip('\r')) + for i in run('find . -name "*.py"').split("\n") + ] if fix: for path_to_file in file_list: @@ -137,6 +140,7 @@ def code_quality(top=10, verbose=True, details=False, fix=False, filename=None): # Sort and slice for item in sorted( results, + reverse=True, key=lambda x: x['total_violations'] )[:end]: