-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Thog-371] Utilize config struct for engine scans #700
Conversation
ahrav
commented
Aug 9, 2022
•
edited
Loading
edited
- Define a config struct within sources that encompasses all the configurations used for all the engine scanning integrations.
- Construct each config within main for each source using functional args.
- Pass the config as the second argument to each of the engine scan methods.
- Update all the tests.
if err != nil { | ||
return errors.WrapPrefix(err, "unable to resolve head ref", 0) | ||
} else { | ||
headRef = head.String() | ||
headCommit, _ = repo.CommitObject(plumbing.NewHash(baseRef)) | ||
c.HeadRef = head.String() |
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.
Comment: Since c
is a pointer, this line will actually change the value for the caller, which may be unexpected or not desired. Not a huge concern because I don't think we use the config again after running the scan, but I thought I'd at least mention it.
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.
yea i did realize that, but figured that it was okay since as you mentioned we only use the cfg in the switch.