Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspatzke committed Jan 5, 2025
1 parent e83c300 commit 05c973d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions sigma/rule/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def from_yaml(

def to_dict(self) -> Dict[str, Any]:
"""Convert rule object into dict."""
d = {
d: Dict[str, Any] = {
"title": self.title,
}
# Convert to string where possible
Expand All @@ -398,15 +398,15 @@ def to_dict(self) -> Dict[str, Any]:

return d

def add_backreference(self, rule: "SigmaRuleBase"):
def add_backreference(self, rule: "SigmaRuleBase") -> None:
"""Add backreference to another rule."""
self._backreferences.append(rule)

def referenced_by(self, rule: "SigmaRuleBase") -> bool:
"""Check if rule is referenced by another rule."""
return rule in self._backreferences

def set_conversion_result(self, result: List[Any]):
def set_conversion_result(self, result: List[Any]) -> None:
"""Set conversion result."""
self._conversion_result = result

Expand All @@ -415,11 +415,12 @@ def get_conversion_result(self) -> List[Any]:
if self._conversion_result is None:
raise sigma_exceptions.SigmaConversionError(
self,
None,
"Conversion result not available",
)
return self._conversion_result

def set_conversion_states(self, state: List["sigma.conversion.state.ConversionState"]):
def set_conversion_states(self, state: List["sigma.conversion.state.ConversionState"]) -> None:
"""Set conversion state."""
self._conversion_states = state

Expand All @@ -428,11 +429,12 @@ def get_conversion_states(self) -> List["sigma.conversion.state.ConversionState"
if self._conversion_states is None:
raise sigma_exceptions.SigmaConversionError(
self,
None,
"Conversion state not available",
)
return self._conversion_states

def disable_output(self):
def disable_output(self) -> None:
"""Disable output of rule."""
self._output = False

Expand Down

0 comments on commit 05c973d

Please sign in to comment.