From 2911dde5880c8cd79b9d35d40c2ceed2f5f176ec Mon Sep 17 00:00:00 2001 From: Xyphuz Date: Sat, 21 May 2022 17:47:35 +0800 Subject: [PATCH] chore: apply pre-commit hooks --- compose_viz/parser.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/compose_viz/parser.py b/compose_viz/parser.py index 85ea484..bfac019 100644 --- a/compose_viz/parser.py +++ b/compose_viz/parser.py @@ -5,6 +5,7 @@ from ruamel.yaml import YAML from compose_viz.compose import Compose, Service from compose_viz.extends import Extends + class Parser: def __init__(self): pass @@ -44,7 +45,7 @@ class Parser: else: service_networks = list(service["networks"].keys()) print("networks: {}".format(service_networks)) - + service_image: Optional[str] = None if service.get("image"): service_image = service["image"] @@ -54,15 +55,9 @@ class Parser: if service.get("extends"): service_extends = Extends(service_name=service["extends"]["service"]) print("extends: {}".format(service_extends)) - services.append( - Service( - name=service_name, - image=service_image, - networks=service_networks, - extends=service_extends - ) + Service(name=service_name, image=service_image, networks=service_networks, extends=service_extends) ) # create Compose object