Skip to content

Commit

Permalink
WIP: conversion/base
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspatzke committed Feb 16, 2025
1 parent 4fd44ab commit 39a9a7b
Show file tree
Hide file tree
Showing 5 changed files with 284 additions and 153 deletions.
2 changes: 1 addition & 1 deletion sigma/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def from_dicts(
in the errors property individually for each Sigma rule and the whole SigmaCollection.
"""
errors = []
parsed_rules = list()
parsed_rules: List[SigmaRuleBase] = list()
prev_rule = None
global_rule: NestedDict = dict()

Expand Down
3 changes: 2 additions & 1 deletion sigma/conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def parent_chain_condition_classes(self) -> List[Type["ConditionType"]]:
"""Only return list of parent chain condition classes which are boolean operators."""
return [item for item in self.parent_chain_classes() if item.operator]

def parent_condition_chain_contains(self, cond_class: Type["ConditionType"]):
def parent_condition_chain_contains(self, cond_class: Type["ConditionType"]) -> bool:
"""Determines if the class cond_class is contained in parent condition class chain."""
return cond_class in self.parent_chain_condition_classes()

Expand Down Expand Up @@ -295,4 +295,5 @@ def parsed(self):
ConditionNOT,
ConditionFieldEqualsValueExpression,
ConditionValueExpression,
ConditionItem,
]
Loading

0 comments on commit 39a9a7b

Please sign in to comment.