summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2020-12-23 15:15:41 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2020-12-23 16:17:54 -0800
commit1571d6240be4ef0757244295c9a60469bfb600f0 (patch)
tree5239848bde6b09f75ad03173166e099cfef6985c /lib
parent0bb18d8a3811a8b915626eab10e04f6a89ae6f64 (diff)
downloadspack-1571d6240be4ef0757244295c9a60469bfb600f0.tar.gz
spack-1571d6240be4ef0757244295c9a60469bfb600f0.tar.bz2
spack-1571d6240be4ef0757244295c9a60469bfb600f0.tar.xz
spack-1571d6240be4ef0757244295c9a60469bfb600f0.zip
style: ensure that all packages pass `spack style -a`
- fix trailing whitespace and other issues uncovered by better flake8 checking. - fix extra whitespace printed by `spack style` command
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/info.py2
-rw-r--r--lib/spack/spack/cmd/style.py2
-rw-r--r--lib/spack/spack/test/cmd/dependencies.py14
3 files changed, 13 insertions, 5 deletions
diff --git a/lib/spack/spack/cmd/info.py b/lib/spack/spack/cmd/info.py
index fa674317ab..9c9c0faee2 100644
--- a/lib/spack/spack/cmd/info.py
+++ b/lib/spack/spack/cmd/info.py
@@ -111,7 +111,7 @@ class VariantFormatter(object):
yield ' None'
else:
yield ' ' + self.fmt % self.headers
- underline = tuple([l * "=" for l in self.column_widths])
+ underline = tuple([w * "=" for w in self.column_widths])
yield ' ' + self.fmt % underline
yield ''
for k, v in sorted(self.variants.items()):
diff --git a/lib/spack/spack/cmd/style.py b/lib/spack/spack/cmd/style.py
index 62a7b72d8e..9b72849c28 100644
--- a/lib/spack/spack/cmd/style.py
+++ b/lib/spack/spack/cmd/style.py
@@ -183,6 +183,8 @@ def rewrite_and_print_output(
)
for line in output.split("\n"):
+ if not line:
+ continue
print(
re_obj.sub(
cwd_relative,
diff --git a/lib/spack/spack/test/cmd/dependencies.py b/lib/spack/spack/test/cmd/dependencies.py
index 05d0556936..8518f2e80d 100644
--- a/lib/spack/spack/test/cmd/dependencies.py
+++ b/lib/spack/spack/test/cmd/dependencies.py
@@ -51,8 +51,11 @@ def test_direct_installed_dependencies(mock_packages, database):
with color_when(False):
out = dependencies('--installed', 'mpileaks^mpich')
- lines = [l for l in out.strip().split('\n') if not l.startswith('--')]
- hashes = set([re.split(r'\s+', l)[0] for l in lines])
+ lines = [
+ line for line in out.strip().split('\n')
+ if not line.startswith('--')
+ ]
+ hashes = set([re.split(r'\s+', line)[0] for line in lines])
expected = set([spack.store.db.query_one(s).dag_hash(7)
for s in ['mpich', 'callpath^mpich']])
@@ -65,8 +68,11 @@ def test_transitive_installed_dependencies(mock_packages, database):
with color_when(False):
out = dependencies('--installed', '--transitive', 'mpileaks^zmpi')
- lines = [l for l in out.strip().split('\n') if not l.startswith('--')]
- hashes = set([re.split(r'\s+', l)[0] for l in lines])
+ lines = [
+ line for line in out.strip().split('\n')
+ if not line.startswith('--')
+ ]
+ hashes = set([re.split(r'\s+', line)[0] for line in lines])
expected = set([spack.store.db.query_one(s).dag_hash(7)
for s in ['zmpi', 'callpath^zmpi', 'fake',