-
Notifications
You must be signed in to change notification settings - Fork 599
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
chore: replace all shorthand tags of mapstruct -> mapstructure #3633
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Christopher Phillips <[email protected]>
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.
These files under the syft/
package are all part of the syft library API. These do not use mapstructure for anything, which is probably why no one has reported issues with these tags before. The only structs that use mapstructure are the config structs, which all reside next to the command-specific stuff under the top-level cmd/
package, such as the command options structs or the options.
I think having these tags on these structs in the syft/
package at all is confusing and we should remove all the mapstructure and mapstruct tags on these structs so contributors don't keep adding them for no reason and potentially confuse these structs with CLI configuration structs.
Other than that, it doesn't really hurt anything to have these tags, but I would update them to match the json tags or the fields exactly -- some of them have changes to the case of letters (e.g. .AuthorEmail
vs Authoremail
-- the former would have been used in the absence of an appropriate mapstructure
tag, so fixing the tag changes the behavior.)
Signed-off-by: Christopher Phillips <[email protected]>
I've updated them to match their fields with the correct casing. I'm not sure about removing them from syft/syft/pkg/cataloger/javascript/parse_package_json.go Lines 83 to 102 in a16e374
We can potentially remove them for the python/swipl case as those structs are not used by any downstream |
Description
When doing #3631 I noticed that syft had some incorrect tags for map-structure that might have been auto completed incorrectly in prior PR. This PR updates the struct tags to use the correct
mapstructure