-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(placeholders): allow regex valuelist transformation #322
base: main
Are you sure you want to change the base?
Conversation
@@ -706,9 +705,26 @@ class SigmaRegularExpression(SigmaType): | |||
SigmaRegularExpressionFlag.DOTALL: "s", | |||
} | |||
|
|||
def __post_init__(self): | |||
def __init__( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason to use __init__
instead of __post_init__
? A string regexp
can also be replaced in __post_init__
.
@@ -689,12 +689,11 @@ class SigmaRegularExpressionFlag(Enum): | |||
DOTALL = auto() | |||
|
|||
|
|||
@dataclass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer to keep this as dataclass for the provided features, consistency and clean structure.
def __eq__(self, other: "SigmaRegularExpression") -> bool: | ||
if isinstance(other, self.__class__): | ||
return self.regexp == other.regexp and self.flags == other.flags | ||
else: | ||
raise NotImplementedError( | ||
"SigmaRegularExpression can only be compared with another SigmaRegularExpression" | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary to implement in a dataclass.
Regarding the transition of If we use a On the other hand, using Moving away from a If we decide to keep it as a |
Init-only variables are the solution for such situations in dataclasses. Here the init-only variable would be the |
No description provided.