Kubebuilder: [V3] Marker pattern

Created on 21 Feb 2020  路  6Comments  路  Source: kubernetes-sigs/kubebuilder

In v2, markers follow // +kubebuilder:* pattern.

In v3, we may want to remove the space (//+kubebuilder:*) as machine-readable comments should not have spaces by Go conventions.

Code to modify:

https://github.com/kubernetes-sigs/kubebuilder/blob/5dc6055cae706f0b80b05484ffe2632d2de56dd3/pkg/model/file/marker.go#L27-L29

/kind feature

help wanted kinfeature triagaccepted triagneeds-information

All 6 comments

Hi @Adirio,

I have thought more about this issue and I am not sure if we should do that. See that by default the common practice is to add comments as // mycomment with space. Also, note that it has the marker # as well, so this change would not be consistent.

also, could you add please add the link for we are able to check this Go convection?

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

/remove-lifecycle stale

@camilamacedo86 You can see in https://github.com/golang/go/issues/37974 how they are even including support in go doc to not document directives (which are machine-readable comments that don't start by a whitespace).

I initially had concerns that this would cause more work due to linters... the gocritic linter does check for spaces after the // however it allows for build tags to not have spaces.
After some research... this makes sense and aligns with recent changes in go conventions
nice recommendation @Adirio !

@camilamacedo86 we can remove the triage label (I don't have rights and I don't think we need any more information)

I can take this one
/assign

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Adirio picture Adirio  路  5Comments

robherley picture robherley  路  5Comments

hasbro17 picture hasbro17  路  5Comments

bingosummer picture bingosummer  路  6Comments

gerred picture gerred  路  4Comments