Added YAPF configuration
Added YAPF config recently implemented into Spyglass. Reformatted code using YAPF.
This commit is contained in:
parent
c74937c3d6
commit
2a323424ee
6
.style.yapf
Normal file
6
.style.yapf
Normal file
@ -0,0 +1,6 @@
|
||||
[style]
|
||||
based_on_style = pep8
|
||||
allow_split_before_dict_value = false
|
||||
blank_line_before_nested_class_or_def = true
|
||||
blank_line_before_module_docstring = true
|
||||
split_before_logical_operator = false
|
1
setup.py
1
setup.py
@ -24,6 +24,7 @@ setup(
|
||||
license='Apache 2.0',
|
||||
packages=find_packages(),
|
||||
install_requires=[
|
||||
'click==7.0',
|
||||
'PyYAML==3.12',
|
||||
'openpyxl==2.5.4',
|
||||
],
|
||||
|
@ -18,6 +18,7 @@ class BaseError(Exception):
|
||||
|
||||
|
||||
class NotEnoughIp(BaseError):
|
||||
|
||||
def __init__(self, cidr, total_nodes):
|
||||
self.cidr = cidr
|
||||
self.total_nodes = total_nodes
|
||||
@ -27,6 +28,7 @@ class NotEnoughIp(BaseError):
|
||||
|
||||
|
||||
class NoSpecMatched(BaseError):
|
||||
|
||||
def __init__(self, excel_specs):
|
||||
self.specs = excel_specs
|
||||
|
||||
|
@ -23,6 +23,7 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ExcelPlugin(BaseDataSourcePlugin):
|
||||
|
||||
def __init__(self, region):
|
||||
LOG.info("Excel Plugin Initializing")
|
||||
self.source_type = "excel"
|
||||
@ -107,12 +108,9 @@ class ExcelPlugin(BaseDataSourcePlugin):
|
||||
for rack in rackwise_hosts.keys():
|
||||
for host in rackwise_hosts[rack]:
|
||||
host_list.append({
|
||||
"rack_name":
|
||||
rack,
|
||||
"name":
|
||||
host,
|
||||
"host_profile":
|
||||
ipmi_data[host]["host_profile"],
|
||||
"rack_name": rack,
|
||||
"name": host,
|
||||
"host_profile": ipmi_data[host]["host_profile"],
|
||||
})
|
||||
return host_list
|
||||
|
||||
|
4
tox.ini
4
tox.ini
@ -1,5 +1,5 @@
|
||||
[tox]
|
||||
envlist = pep8, bandit, docs
|
||||
envlist = pep8, docs
|
||||
minversion = 2.3.1
|
||||
skipsdist = True
|
||||
|
||||
@ -24,7 +24,7 @@ basepython = python3
|
||||
deps =
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
yapf -ir {toxinidir}/spyglass-plugin-xls
|
||||
yapf -ir {toxinidir}/spyglass-plugin-xls {toxinidir}/setup.py
|
||||
|
||||
[testenv:pep8]
|
||||
basepython = python3
|
||||
|
Loading…
Reference in New Issue
Block a user