-
Notifications
You must be signed in to change notification settings - Fork 24
Print qualified field name in error messages #174
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
Conversation
JoelSpeed
left a comment
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.
Approach LGTM, please continue
|
|
||
| // processFieldWithRecovery processes a field with panic recovery. | ||
| func (i *inspector) processFieldWithRecovery(field *ast.Field, inspectField func(field *ast.Field, jsonTagInfo extractjsontags.FieldTagInfo, markersAccess markers.Markers)) { | ||
| func (i *inspector) processFieldWithRecovery(field *ast.Field, qualifiedFieldName string, inspectField func(field *ast.Field, jsonTagInfo extractjsontags.FieldTagInfo, markersAccess markers.Markers, qualifiedFieldName 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.
Hi @Karthik-K-N was wondering if there is a specific reason to pass qualifiedFieldName string twice here?
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.
Thats because qualifiedFieldName is constructed in i.inspector.WithStack() function and passed to processFieldWithRecovery function and from where it will be passed to the inspectField function.
Function definition of inspectField function looks like this
inspectField func(field *ast.Field, jsonTagInfo extractjsontags.FieldTagInfo, markersAccess markers.Markers, qualifiedFieldName string)
inspectField is what used by the analyzers.
93c3c33 to
eef97b4
Compare
|
Implemented the error message handling for most of the linters, Only optionalfields and requiredfields are pending will take it in a separate PR. |
|
@JoelSpeed PR is ready for review, Please take a look when time permits, Thanks. |
|
@Karthik-K-N Would you mind rebasing and resolving the conflicts? |
JoelSpeed
left a comment
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.
Apart from the merge conflicts, this LGTM, thanks @Karthik-K-N
0e3433f to
ee219d1
Compare
|
Done, Thank you. |
|
Also just a thought, Currently the pkg/analysis contains both anaylysers, helpers, utils, May be if the analyzers are separated out into separate directory. It may look well organised. |
|
/lgtm Thanks for this one
Yeah there's definitely some potential for re-organisation. I'd probably pick the utils out and maybe put the helpers as a sibling to |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JoelSpeed, Karthik-K-N The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Yeah, Though they are analysers, I feel its more like analyzer's helpers, Like analyzers actually doing work and internally these helps them. |
Fixes: #158