Skip to content
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

Confusion on camelCase versus PascalCase #2283

Open
ukanuk opened this issue Oct 12, 2024 · 0 comments
Open

Confusion on camelCase versus PascalCase #2283

ukanuk opened this issue Oct 12, 2024 · 0 comments
Labels
enhancement New feature or request style-linter Verilog style-linter issues

Comments

@ukanuk
Copy link

ukanuk commented Oct 12, 2024

https://chipsalliance.github.io/verible/verilog_lint.html includes some information on style defaults:

localparam_style Default: CamelCase Style of localparam names
parameter_style Default: CamelCase|ALL_CAPS Style of parameter names.

But that confuses camelCase with PascalCase. Just from the documentation, it is not clear which of these code examples would be the lint default (lowercase "b" versus uppercase "B")

localparam [1:0] buttonOneshot = 1,
localparam [1:0] ButtonOneshot = 1,

The same page includes a link to https://github.com/chipsalliance/verible/tree/master/verilog/tools/lint#regular-expressions referencing other common naming styles. It is correctly shown as camelCase not not CamelCase on that page. Another inconsistency is it's called ALL_CAPS in the former but UPPER_SNAKE_CASE in the latter. Full list from the regex reference page:

For naming style rules, the regex can be kept simple and not have to worry about the beginning starting with a digit as this is already taken care of by the lexer/parser. Below are some common naming style regex patterns that can be used.

Case Regex
lower_snake_case [a-z_0-9]+
UPPER_SNAKE_CASE [A-Z_0-9]+
Title_Snake_Case [A-Z]+[a-z0-9](_[A-Z0-9]+[a-z0-9])*
Sentence_snake_case ([A-Z0-9]+[a-z0-9]_?)([a-z0-9]_)
camelCase ([a-z0-9]+[A-Z0-9]*)+
PascalCase ([A-Z0-9]+[a-z0-9]*)+
@ukanuk ukanuk added enhancement New feature or request style-linter Verilog style-linter issues labels Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request style-linter Verilog style-linter issues
Projects
None yet
Development

No branches or pull requests

1 participant