protolint icon indicating copy to clipboard operation
protolint copied to clipboard

Is there a way to add custom rule options in custom rules?

Open haroldlim opened this issue 5 years ago • 4 comments

For example, I want to introduce a new custom rule and then in the protolint.yaml file's rules_option section introduce new options for that particular custom rule?

haroldlim avatar Nov 17 '20 21:11 haroldlim

@haroldlim Thank you for your interest in a custom rule.

Unfortunately, a protolint.yaml doesn't support options for custom rules at the moment. I thought the need didn't seem to be so strong because the user can pass any options in a plugin's main.go like:

https://github.com/yoheimuta/protolint/blob/4a1b88feba6c0e9e2bf826f79cf1eda4b2a7effa/_example/plugin/main.go#L13

Let me know what you think.

yoheimuta avatar Nov 21 '20 04:11 yoheimuta

@yoheimuta

I think the issue with the above suggestion is that we always need to rebuild the custom plugin binary if we want to make changes?

What I was thinking is have some configurable options that we can specify in the yaml file and then the custom rule can take it in.

haroldlim avatar Nov 24 '20 17:11 haroldlim

@haroldlim That's right. It makes sense that some users would find it useful to change the behavior without rebuilding. I was not sure about its demand actually, but if you need this nice feature, I'll add an enhancement label to this issue.

yoheimuta avatar Nov 25 '20 00:11 yoheimuta

Yes. Please add enhancement label.

haroldlim avatar Nov 25 '20 16:11 haroldlim