-
Notifications
You must be signed in to change notification settings - Fork 25
Fix marker detection for fields with orphaned markers #199
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
Fix marker detection for fields with orphaned markers #199
Conversation
2082515 to
c0f32c7
Compare
c0f32c7 to
19f1732
Compare
|
The lint issue is inherited from |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JoelSpeed, saschagrunert 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 |
Markers separated from field declarations by blank lines were not being
detected.
Example:
type FooStatus struct {
// +optional
// +listType=map
// Conditions update as changes occur.
Conditions []metav1.Condition
}
The fix detects orphaned marker blocks (containing only markers, no
prose) that precede a field's doc comment, while avoiding false
positives from adjacent field markers.
Performance optimizations:
- Pre-compute field Doc comment map to avoid O(n²) complexity
- Use regex validation instead of full marker parsing in containsOnlyMarkers
- Results in 93-95% reduction in AST node visits for files with orphaned markers
kubernetes-sigs#53
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
19f1732 to
e13a02f
Compare
|
Rebased to the the linter fixes in. |
|
/lgtm |
Markers separated from field declarations by blank lines were not being detected.
The fix detects orphaned marker blocks (containing only markers, no prose) that precede a field's doc comment, while avoiding false positives from adjacent field markers.
Fixes #53