summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2017-10-24 11:29:18 +0200
committerGitHub <noreply@github.com>2017-10-24 11:29:18 +0200
commit3f68cc2ba77c8009c5cac5bbf9f42e19b5f79bc2 (patch)
tree5ca7efbe3ad884d1d4d9d5094bedffd800d6a185 /lib
parent896d4c8d0c933b7aafc862dfa8e83c4ec6cbb933 (diff)
downloadspack-3f68cc2ba77c8009c5cac5bbf9f42e19b5f79bc2.tar.gz
spack-3f68cc2ba77c8009c5cac5bbf9f42e19b5f79bc2.tar.bz2
spack-3f68cc2ba77c8009c5cac5bbf9f42e19b5f79bc2.tar.xz
spack-3f68cc2ba77c8009c5cac5bbf9f42e19b5f79bc2.zip
Fix bug in spack flake8 when no files differ from develop (#5898)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/flake8.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/spack/spack/cmd/flake8.py b/lib/spack/spack/cmd/flake8.py
index 53eea0b995..33f7a5e833 100644
--- a/lib/spack/spack/cmd/flake8.py
+++ b/lib/spack/spack/cmd/flake8.py
@@ -264,6 +264,7 @@ def flake8(parser, args):
package_file_list = [f for f in file_list if is_package(f)]
file_list = [f for f in file_list if not is_package(f)]
+ returncode = 0
with working_dir(temp):
output = ''
if file_list:
@@ -271,12 +272,14 @@ def flake8(parser, args):
'--format', 'pylint',
'--config=%s' % os.path.join(spack.prefix, '.flake8'),
*file_list, fail_on_error=False, output=str)
+ returncode |= flake8.returncode
if package_file_list:
output += flake8(
'--format', 'pylint',
'--config=%s' % os.path.join(spack.prefix,
'.flake8_packages'),
*package_file_list, fail_on_error=False, output=str)
+ returncode |= flake8.returncode
if args.root_relative:
# print results relative to repo root.
@@ -290,7 +293,7 @@ def flake8(parser, args):
for line in output.split('\n'):
print(re.sub(r'^(.*): \[', cwd_relative, line))
- if flake8.returncode != 0:
+ if returncode != 0:
print('Flake8 found errors.')
sys.exit(1)
else: