Skip to content

Conversation

@Karthik-K-N
Copy link
Contributor

@Karthik-K-N Karthik-K-N commented Oct 31, 2025

Fixes: #158

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 31, 2025
Copy link
Contributor

@JoelSpeed JoelSpeed left a 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)) {
Copy link
Contributor

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?

Copy link
Contributor Author

@Karthik-K-N Karthik-K-N Nov 3, 2025

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 3, 2025
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 5, 2025
@Karthik-K-N
Copy link
Contributor Author

Implemented the error message handling for most of the linters, Only optionalfields and requiredfields are pending will take it in a separate PR.

@Karthik-K-N
Copy link
Contributor Author

@JoelSpeed PR is ready for review, Please take a look when time permits, Thanks.

@JoelSpeed
Copy link
Contributor

@Karthik-K-N Would you mind rebasing and resolving the conflicts?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 6, 2025
Copy link
Contributor

@JoelSpeed JoelSpeed left a 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

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 6, 2025
@Karthik-K-N
Copy link
Contributor Author

Done, Thank you.

@Karthik-K-N
Copy link
Contributor Author

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.

@JoelSpeed
Copy link
Contributor

/lgtm
/approve

Thanks for this one

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.

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 analysis, though they are kind of analyzers in their own right 🤔

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 6, 2025
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 6, 2025
@JoelSpeed JoelSpeed merged commit 396f2c2 into kubernetes-sigs:main Nov 6, 2025
3 of 5 checks passed
@Karthik-K-N
Copy link
Contributor Author

/lgtm /approve

Thanks for this one

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.

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 analysis, though they are kind of analyzers in their own right 🤔

Yeah, Though they are analysers, I feel its more like analyzer's helpers, Like analyzers actually doing work and internally these helps them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update all analyzers to output <struct name>.<field name> for more precise error message output

4 participants