-
Notifications
You must be signed in to change notification settings - Fork 284
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
struct-tag rule false-positive on json inline tag #520
Comments
Hi @finnan444 thanks for filling the issue. (Actually, the |
Hi @chavacava, sorry for inconvenience, this tag is widely used in my company (this practice came from kubernetes repo), so i thought |
Do not worry, we have been all trapped by this Thanks again for taking the time of filling the issue. |
@chavacava So why not add a configuration option to struct-tag linter? |
@s3rj1k What do you need to configure? |
I was thinking of an array with additionally allowed list of tags, to make that |
Could you please develop on the interest of using non-standard options in struct tags? |
@chavacava inline tag is needed for kubernetes CRD creation, please see link below |
I do not know about CRD creation but I know that non standard tag options are ignored by
If we add a configuration, it should allow additional options but scoped to particular tags. For example, by allowing |
@chavacava inline is used across all K8s code, for example here https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/garbagecollector/metaonly/types.go#L30 I would rather use it also like docs say.
Sure, so a list per tag or a map[string][]string |
I know. I use Kubernetes repo as the main sandbox for testing new linting rules because: a) it is a huge repo and, b) it is not famous for its coding style quality ;) |
So, either we have some kind of a configurable option for struct-tag, to allow this K8s mess and have other struct tags checked or we go and disable struct-tag linter for specific places or for all code base. Personally I would be happy with configuration option, that way linter will work on other structs inside project. |
@chavacava Bump, I am forced to use exclude rule for this and this is ugly. |
Describe the bug
struct-tag produces warning for json inline tag
struct-tag: unknown option 'inline' in JSON tag (revive)
To Reproduce
Steps to reproduce the behavior:
The text was updated successfully, but these errors were encountered: