-
Notifications
You must be signed in to change notification settings - Fork 23
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
refactor: refactor interface of base check #513
Conversation
You probably need to regenerate the API doc with |
@@ -176,14 +176,14 @@ def get_slsa_level_table(self) -> SLSALevel: | |||
|
|||
def get_dict(self) -> dict: | |||
"""Return the dictionary representation of the AnalyzeContext instance.""" | |||
_sorted_on_id = sorted(self.check_results.values(), key=lambda item: item["check_id"]) | |||
_sorted_on_id = sorted(self.check_results.values(), key=lambda item: item.check.check_id) | |||
# Remove result_tables since we don't have a good json representation for them. | |||
sorted_on_id = [] | |||
for res in _sorted_on_id: | |||
# res is CheckResult(TypedDict) |
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.
This comment should be adjusted.
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.
Done.
@nicallen It would be good to add a Developer Docs page to describe the check interface. We already have a |
@nicallen I think it makes sense to change the commit scope to |
Sounds good. @nicallen please rebase on |
Refactor BaseCheck.run_check to return all result info as part of return value, rather than passing in and mutating a CheckResult object containing other data irrelevant to run_check. Refactor SLSA requirement status information in AnalyzeContext to avoid unnecessary replication of generic info about a SLSA requirement, which can be looked up by ReqName when needed instead. Signed-off-by: Nicholas Allen <[email protected]>
Signed-off-by: Nicholas Allen <[email protected]>
Signed-off-by: Nicholas Allen <[email protected]>
Signed-off-by: Nicholas Allen <[email protected]>
…ng unittest. Signed-off-by: Nicholas Allen <[email protected]>
Signed-off-by: Nicholas Allen <[email protected]>
831955a
to
a28940d
Compare
I have created an separate issue for this (#535), I don't think we need to do this immediately as part of this PR. |
…he comment. Signed-off-by: Nicholas Allen <[email protected]>
a28940d
to
9a61b7c
Compare
Refactor BaseCheck.run_check to return all result info as part of return value, rather than passing in and mutating a CheckResult object containing other data irrelevant to run_check. Refactor SLSA requirement status information in AnalyzeContext to avoid unnecessary replication of generic info about a SLSA requirement, which can be looked up by ReqName when needed instead. Signed-off-by: Nicholas Allen <[email protected]>
Refactor BaseCheck.run_check to return all result info as part of return value, rather than passing in and mutating a CheckResult object containing other data irrelevant to run_check.
Refactor SLSA requirement status information in AnalyzeContext to avoid unnecessary replication of generic info about a SLSA requirement, which can be looked up by ReqName when needed instead.