flake8: make entire repository pass spack flake8 -a

- Fix trailing whitespace missed by the bug described in #12755.

- Fix other style issues that have crept in over time (this can happen
  when flake8 adds new checks with new versions)
This commit is contained in:
Todd Gamblin
2019-09-07 19:27:51 -07:00
parent 0ec80e8f16
commit a2220f3150
69 changed files with 346 additions and 337 deletions

View File

@@ -231,7 +231,7 @@ def install_args(self, spec, prefix):
if ('py-setuptools' == spec.name or # this is setuptools, or
'py-setuptools' in spec._dependencies and # it's an immediate dep
'build' in spec._dependencies['py-setuptools'].deptypes):
args += ['--single-version-externally-managed', '--root=/']
args += ['--single-version-externally-managed', '--root=/']
return args

View File

@@ -57,7 +57,7 @@ def setup_parser(subparser):
index = subparsers.add_parser('index', help=update_index.__doc__)
index.add_argument('-e', '--endpoint-url',
default='https://s3.spack.io', help='URL of mirror')
default='https://s3.spack.io', help='URL of mirror')
index.set_defaults(func=update_index)

View File

@@ -247,8 +247,8 @@ def add_subcommand_group(title, commands):
spack help --all list all commands and options
spack help <command> help on a specific command
spack help --spec help on the package specification syntax
spack docs open http://spack.rtfd.io/ in a browser"""
.format(help=section_descriptions['help']))
spack docs open http://spack.rtfd.io/ in a browser
""".format(help=section_descriptions['help']))
# determine help from format above
return formatter.format_help()

View File

@@ -78,7 +78,7 @@
}
},
'patternProperties': {
r'^(?!when$)\w*': spec_list_schema
r'^(?!when$)\w*': spec_list_schema
}
}
},
@@ -87,35 +87,36 @@
'anyOf': [
{'type': 'boolean'},
{'type': 'string'},
{'type': 'object',
'patternProperties': {
r'\w+': {
'required': ['root'],
'additionalProperties': False,
'properties': {
'root': {
'type': 'string'
},
'link': {
'type': 'string',
'pattern': '(roots|all)',
},
'select': {
'type': 'array',
'items': {
'type': 'string'
}
},
'exclude': {
'type': 'array',
'items': {
'type': 'string'
}
},
'projections': projections_scheme
}
}
}
{
'type': 'object',
'patternProperties': {
r'\w+': {
'required': ['root'],
'additionalProperties': False,
'properties': {
'root': {
'type': 'string'
},
'link': {
'type': 'string',
'pattern': '(roots|all)',
},
'select': {
'type': 'array',
'items': {
'type': 'string'
}
},
'exclude': {
'type': 'array',
'items': {
'type': 'string'
}
},
'projections': projections_scheme
}
}
}
}
]
}

View File

@@ -83,8 +83,9 @@
'cdash': {
'oneOf': [
{'type': 'string'},
{'type': 'array',
'items': {'type': 'string'}
{
'type': 'array',
'items': {'type': 'string'}
},
],
},

View File

@@ -616,7 +616,7 @@ def test_bad_command_line_scopes(tmpdir, mock_config):
def test_add_command_line_scopes(tmpdir, mutable_config):
config_yaml = str(tmpdir.join('config.yaml'))
with open(config_yaml, 'w') as f:
f.write("""\
f.write("""\
config:
verify_ssl: False
dirty: False

View File

@@ -27,15 +27,14 @@ def subtract(self):
def implementation(interface):
"""Returns an implementation of the interface"""
class Implementation(interface):
def __init__(self, value):
self.value = value
def __init__(self, value):
self.value = value
def add(self):
interface.counter += self.value
def add(self):
interface.counter += self.value
def subtract(self):
interface.counter -= self.value
def subtract(self):
interface.counter -= self.value
return Implementation

View File

@@ -714,7 +714,7 @@ def test_disjoint_set_initialization():
# Test that no error is thrown when the sets are disjoint
d = disjoint_sets(('a',), ('b', 'c'), ('e', 'f'))
assert d.default is 'none'
assert d.default == 'none'
assert d.multi is True
assert set(x for x in d) == set(['none', 'a', 'b', 'c', 'e', 'f'])