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

Add a lint to enforce the naming convention in README #5

Open
chengcli opened this issue May 24, 2023 · 2 comments
Open

Add a lint to enforce the naming convention in README #5

chengcli opened this issue May 24, 2023 · 2 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@chengcli
Copy link
Owner

chengcli commented May 24, 2023

Currently, this repo uses cpplint to enforce c++ style. But cpplint does not check naming conventions. Is it possible to find a lint library that check cpp naming convention? Basically, I would like to enforce:

Name your folders and files

  • use a singular simple noun for folder names
  • avoid compound nouns for folder names
  • you can use compound nouns or phrases for files names
  • individual words in a compound nouns for phrase should be concatenated by underscore

Name your variables and classes

  • use low case letters for variables
  • you can use compound nouns or phrases
  • compound nouns for phrase should be concatenated by underscore. This is called the snake case
  • if a compound noun is used for class name, capitalize each word in the compound noun.
    This is called the upper camel case
  • if a variable is a private member of a class, append the variable name with an
    underscore

Name your funcions

  • functions names are usualy verbal phrases
  • standalone functions should use snake case
  • public class member functions should use upper camel case
  • private class member functions should use lower camel case in which the first word
    in a phase is not capitalized and the rest words are capitalized
@chengcli chengcli added the help wanted Extra attention is needed label May 24, 2023
@happysky19
Copy link
Collaborator

@chengcli
Copy link
Owner Author

chengcli commented Jun 2, 2023

Yes, I think this can work. When you have a script to check, I'll give you an example of running it during pre-commit.

luminoctum added a commit that referenced this issue Oct 29, 2023
Introduces TasksGroup to manage tasks
chengcli pushed a commit that referenced this issue Oct 29, 2023
Introduces TasksGroup to manage tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants