Skip to content

Commit

Permalink
linting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonrobbins committed Jun 26, 2024
1 parent dcdc920 commit 0cd1062
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/attack_flow/mermaid.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def add_edge(self, src_id, target_id, text):
def render(self):
# Mermaid can't handle IDs with hyphens in them:
convert_id = lambda id_: id_.replace("-", "_")
if self.direction:
if self.direction:
lines = [f"graph {self.direction}"]
else:
lines = ["graph TB"]
Expand All @@ -50,7 +50,7 @@ def render(self):
if self.classes[node_class][0] == "circle":
shape_start = "(("
shape_end = "))"
elif self.classes[node_class][0] =="trap":
elif self.classes[node_class][0] == "trap":
shape_start = "[/"
shape_end = "\]"
else:
Expand Down Expand Up @@ -126,7 +126,8 @@ def convert_attack_flow(bundle):
graph.add_node(o.id, "builtin", " - ".join(label_lines))

return graph.render()



def convert_attack_tree(bundle):

"""
Expand All @@ -147,7 +148,7 @@ def convert_attack_tree(bundle):
objects = bundle.objects
id_to_remove = []
ids = []

for i, o in enumerate(objects):
if o.type == "attack-operator":
id_to_remove.append(
Expand All @@ -172,7 +173,6 @@ def convert_attack_tree(bundle):
if j == operator["id"]:
o.effect_refs[i] = operator["next_id"]


for o in bundle.objects:
if o.type == "attack-action":
if tid := o.get("technique_id", None):
Expand Down

0 comments on commit 0cd1062

Please sign in to comment.