Skip to content

Refactor to use Dependency structure #564

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

Merged
merged 9 commits into from
May 12, 2025
Merged

Conversation

sobregosodd
Copy link
Contributor

@sobregosodd sobregosodd commented May 8, 2025

Background:
Historically guarddog uses dicts as DTOs for several purposes, one major problem is that they are passed from function to nested functions and that combined with the lack of proper OOP produces lots of runtime errors, since each function assumes a different data structure.
This approach also makes it very complex to enhance or change the structure without a major impact.

Solution:
This PR replaces the use of a dictionary with a structured @dataclass object for dependencies forcing functions to standardize and respect the type check.

Fixes: #558
Fixes: #261

@sobregosodd sobregosodd marked this pull request as draft May 8, 2025 10:56
@sobregosodd sobregosodd marked this pull request as ready for review May 8, 2025 14:27
@sobregosodd sobregosodd requested a review from ikretz May 9, 2025 08:57
Copy link
Contributor

@ikretz ikretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, ready to approve, just a few questions here and there first.

@sobregosodd sobregosodd requested a review from ikretz May 12, 2025 14:37
@sobregosodd sobregosodd merged commit cf77c40 into main May 12, 2025
9 checks passed
@sobregosodd sobregosodd deleted the s.obregoso/fix_sarif branch May 12, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants