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

Prefix rules #112

Merged
merged 21 commits into from
Jan 18, 2022
Merged

Prefix rules #112

merged 21 commits into from
Jan 18, 2022

Conversation

DaveMcEwan
Copy link
Contributor

  • New rules for naming convention of interfaces, modules, and packages.
    • prefix_interface
    • prefix_module
    • prefix_package
    • uppercamelcase_interface
    • uppercamelcase_module
    • lowercamelcase_package
  • New rule prefix_instance for prefix on instance names, defaulting to "u_".
  • Modified generate_for_with_label and generate_if_with_label to check for prefix.
    For old behaviour (only existence check), the prefix_label. option can be set to "".
  • New rule generate_case_with_label similar to the above.

@dalance
Copy link
Owner

dalance commented Jan 4, 2022

Thank you for a lot of controbution!
I think all rules are reasonable, but it may be better that the naming convention can be selectable.
For example, uppercamelcase_interface, lowercamelcase_interface, snakecase_interface.

@DaveMcEwan
Copy link
Contributor Author

Okay cool. I'll add lower/uppercamelcase rules for packages, interfaces, and modules to this PR (soon).
I'd like to leave snakecase rules for a different PR though, if that's okay with you?

@DaveMcEwan
Copy link
Contributor Author

I've now added the rules for lowercamelcase_(interface|module) and uppercamelcase_package.

After a bit more thinking, I'm not sure how snakecase_* checking would work. I often use a mix of CamelCase and snake_case like PartOne_secondPart_PartThree, i.e. underscores are used to separate CamelCase terms. This doesn't really need any more checking except that the first character is upper/lower case. So, I'd like to leave this PR with just the rules for lower/UpperCamelCase.

@dalance
Copy link
Owner

dalance commented Jan 9, 2022

In my understanding, lower snake case aa_bb_cc and upper snake case AA_BB_CC are defined generally.
I don't know the name of combination of snake and camel case.
That aside, I agree the current PR. I'll merge this after checking the diff.

@dalance dalance merged commit 05ef8c7 into dalance:master Jan 18, 2022
@dalance
Copy link
Owner

dalance commented Jan 18, 2022

I merged and released v0.5.0.
Thanks!

@DaveMcEwan DaveMcEwan deleted the prefixRules branch January 18, 2022 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants