chipsalliance / verible

Verible is a suite of SystemVerilog developer tools, including a parser, style-linter, formatter and language server
https://chipsalliance.github.io/verible/
Other
1.38k stars 214 forks source link

how to change lint rule "legacy-generate-region"? #2288

Open ddppt-yy opened 6 days ago

ddppt-yy commented 6 days ago

Summary //Brief description of request. Reference [style-lint-rule-name] if this is //about an existing rule, or suggest new lint rule name. hello: in rule file https://chipsalliance.github.io/verible/lint.html#generate-label-prefix , there is no parameter to user change the style_regex.

May I ask whether modification is not supported or I have not found a way to modify

IEncinas10 commented 6 days ago

The rule specifically checks against gen_ or g_ prefixes https://github.com/chipsalliance/verible/blob/86ee9bab719daed109cf399454f1b486b03900b5/verilog/analysis/checkers/generate_label_prefix_rule.cc#L86

The rule could be generalized to take a regex (or a list of prefixes, ...). In case you're considering giving it a try, this might serve as an example: https://github.com/chipsalliance/verible/blob/master/verilog/analysis/checkers/enum_name_style_rule.cc

ddppt-yy commented 5 days ago

The rule specifically checks against gen_ or g_ prefixes

https://github.com/chipsalliance/verible/blob/86ee9bab719daed109cf399454f1b486b03900b5/verilog/analysis/checkers/generate_label_prefix_rule.cc#L86

The rule could be generalized to take a regex (or a list of prefixes, ...). In case you're considering giving it a try, this might serve as an example: https://github.com/chipsalliance/verible/blob/master/verilog/analysis/checkers/enum_name_style_rule.cc

This means that the user cannot modify the regular expression with test parameters, only by recompiling it to a new linter file, right?

IEncinas10 commented 5 days ago

Right. Currently, there is no way of configuring the rule. But it can be made configurable.

hzeller commented 2 days ago

I think we should keep this open until implemented.

IEncinas10 commented 2 days ago

Agree. Let's leave it open with a good first issue tag. Feel free to ask for directions/help.