-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
feat - Add new file name guidelines #638
feat - Add new file name guidelines #638
Conversation
Do we want uppercase directory names? |
CONTRIBUTION.md
Outdated
- Use lowercase words with ``"_"`` as separator | ||
- For instance | ||
``` | ||
MyNewCppClass.cpp is incorrect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this MyNewCppClass.CPP because we also care about the file extension (.cpp).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, agreed
CONTRIBUTION.md
Outdated
``` | ||
- It will be used to dynamically create a directory of files and implementation. | ||
- File name validation will run on docker to ensure the validity. | ||
|
||
#### Commit Guidelines | ||
- It is recommended to keep your changes grouped logically within individual commits. Contributors find it easier to review changes that are silt across multiple commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
silt --> split
|
So we will need a mega-rename pull request that renames all directories and all filenames? |
I guess so. Finally, any name(directory or file) cannot contain space and '-' , also only lower chars. |
All new or modified C++ files in a pull request will be tested by cpplint in https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/.github/workflows/cpplint_modified_files.yml and if they pass cpplint, they will also be tested for " ", "-", uppercase characters, and that they must be in directories. |
One of the cpplint tests looks for a copyright comment in the file like Do we want to encourage the addition of such comments or do we want to disable that test? Other tests to consider: cpplint --filter=
|
I think we are okay with not adding at this point. @cclauss |
Removed legal/copyright https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/.cpplint#L4 |
CONTRIBUTION.md
Outdated
- File name validation will run on docker to ensure the validity. | ||
|
||
#### New Directory guidelines | ||
- Use lowercase words with ``"_"`` as separator ( no spaces or '-' allowed ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to say that it is best practice to try to use an existing directory rather than adding a new one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added change
@@ -10,7 +10,8 @@ Contributors guide: https://github.com/TheAlgorithms/C-Plus-Plus/CONTRIBUTION.md | |||
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> | |||
|
|||
- [ ] Added description of change | |||
- [ ] Added tests and example, test passes | |||
- [ ] Added file name matches [File name guidelines](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTION.md#New-File-Name-guidelines) | |||
- [ ] Added tests and example, test must pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have some existing tests in this repo that we could site as examples?
Do we want to have a check box for:
- Ran cpplint, test must pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cpplint is run after the PR is created so the dev would have to edit the PR description after the checks have passed. Also working on a example test case and helper test cpp methods to be used for later and different pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cpplint can (and should) be run on their local machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then need add guideline or script to do so?
add new directory updates.
CONTRIBUTION.md
Outdated
@@ -38,7 +38,8 @@ my_new_cpp_class.cpp is correct format | |||
- File name validation will run on docker to ensure the validity. | |||
|
|||
#### New Directory guidelines | |||
- Use lowercase words with ``"_"`` as separator ( no spaces or '-' allowed ) | |||
- We recommend adding files to existing directories as mush as possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mush --> much
spell change for # new directory guidelines
@cclauss Approval? |
Description of Change
Added new file name guidelines, the new contribution needs to be in certain format to be used for the dynamic directory list generator. The file names will be validated using the actions in near future.
Checklist
Notes:
The old file names will be changes soon with one directory at a time.
The old PR might need some re-work.