docs: improve the contributing guidelines (#1996)

This commit is contained in:
David Leal 2022-09-25 16:14:10 -05:00 committed by GitHub
parent eae5a72561
commit fc180b6061
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@
## Before contributing ## Before contributing
Welcome to [TheAlgorithms/C-Plus-Plus](https://github.com/TheAlgorithms/C-Plus-Plus)! Before submitting pull requests, please make sure that you have **read the whole guidelines**. If you have any doubts about this contribution guide, please open [an issue](https://github.com/TheAlgorithms/C-Plus-Plus/issues/new/choose) or ask in our [Discord server](https://discord.gg/c7MnfGFGa6), and clearly state your concerns. Welcome to [TheAlgorithms/C-Plus-Plus](https://github.com/TheAlgorithms/C-Plus-Plus)! Before submitting pull requests, please make sure that you have **read the whole guidelines**. If you have any doubts about this contribution guide, please open [an issue](https://github.com/TheAlgorithms/C-Plus-Plus/issues/new/choose) or ask on our [Discord server](https://discord.gg/c7MnfGFGa6), and clearly state your concerns.
## Contributing ## Contributing
@ -15,13 +15,13 @@ Welcome to [TheAlgorithms/C-Plus-Plus](https://github.com/TheAlgorithms/C-Plus-P
Being a contributor at The Algorithms, we request you to follow the points mentioned below: Being a contributor at The Algorithms, we request you to follow the points mentioned below:
- You did your own work. - You did your own work.
- No plagiarism allowed. Any plagiarized work will not be merged. - No plagiarism is allowed. Any plagiarized work will not be merged.
- Your work will be distributed under the [MIT License](https://github.com/TheAlgoritms/C-Plus-Plus/blob/master/LICENSE) once your pull request has been merged. - Your work will be distributed under the [MIT License](https://github.com/TheAlgoritms/C-Plus-Plus/blob/master/LICENSE) once your pull request has been merged.
- Please follow the repository guidelines and standards mentioned below. - Please follow the repository guidelines and standards mentioned below.
**New implementation** New implementations are welcome! **New implementation** New implementations are welcome!
You can add new algorithms or data structures which are **not present in the repository** or that can **improve** the old implementations (**documentation**, **improving test cases**, removing bugs or in any other reasonable sense) You can add new algorithms or data structures that are **not present in the repository** or that can **improve** the old implementations (**documentation**, **improving test cases**, removing bugs, or in any other reasonable sense)
**Issues** Please avoid opening issues asking to be "assigned” to a particular algorithm. This merely creates unnecessary noise for maintainers. Instead, please submit your implementation in a pull request, and it will be evaluated by project maintainers. **Issues** Please avoid opening issues asking to be "assigned” to a particular algorithm. This merely creates unnecessary noise for maintainers. Instead, please submit your implementation in a pull request, and it will be evaluated by project maintainers.
@ -30,7 +30,7 @@ You can add new algorithms or data structures which are **not present in the rep
#### Code #### Code
- Please use the directory structure of the repository. - Please use the directory structure of the repository.
- Make sure the file extensions should be `*.hpp`, `*.h` or `*.cpp`. - Make sure the file extensions are `*.hpp`, `*.h` or `*.cpp`.
- Don't use **`bits/stdc++.h`** because this is quite Linux-specific and slows down the compilation process. - Don't use **`bits/stdc++.h`** because this is quite Linux-specific and slows down the compilation process.
- Organize your code using **`struct`**, **`class`**, and/or **`namespace`** keywords. - Organize your code using **`struct`**, **`class`**, and/or **`namespace`** keywords.
- If an implementation of the algorithm already exists, please refer to the [file-name section below](#new-file-name-guidelines). - If an implementation of the algorithm already exists, please refer to the [file-name section below](#new-file-name-guidelines).
@ -38,7 +38,7 @@ You can add new algorithms or data structures which are **not present in the rep
- Strictly use snake_case (underscore_separated) in filenames. - Strictly use snake_case (underscore_separated) in filenames.
- If you have added or modified code, please make sure the code compiles before submitting. - If you have added or modified code, please make sure the code compiles before submitting.
- Our automated testing runs [__CMake__](https://cmake.org/) on all the pull requests, so please be sure that your code passes before submitting. - Our automated testing runs [__CMake__](https://cmake.org/) on all the pull requests, so please be sure that your code passes before submitting.
- Please conform to [Doxygen](https://www.doxygen.nl/manual/docblocks.html) standard and document the code as much as possible. This not only facilitates the readers but also generates the correct info on the website. - Please conform to [Doxygen](https://www.doxygen.nl/manual/docblocks.html) standards and document the code as much as possible. This not only facilitates the readers but also generates the correct info on the website.
- **Be consistent in the use of these guidelines.** - **Be consistent in the use of these guidelines.**
#### Documentation #### Documentation
@ -60,7 +60,8 @@ You can add new algorithms or data structures which are **not present in the rep
```cpp ```cpp
/** /**
* @file * @file
* @brief Add one line description here * @brief Add one line description here. Should contain a Wikipedia
* link or another source explaining the algorithm/implementation.
* @details * @details
* This is a multi-line * This is a multi-line
* description containing links, references, * description containing links, references,
@ -73,7 +74,8 @@ You can add new algorithms or data structures which are **not present in the rep
#include /// for `some function here` #include /// for `some function here`
/** /**
* @namespace <check from other files in this repo> * @namespace <folder name>
* @brief <namespace description>
*/ */
namespace name { namespace name {
@ -82,11 +84,11 @@ namespace name {
*/ */
class class_name { class class_name {
private: private:
int variable; ///< short info of this variable int variable; ///< short info of this variable
char *message; ///< short info char *message; ///< short info
public: public:
// other members also documented as below // other members should be also documented as below
} }
/** /**
@ -106,7 +108,7 @@ bool func(int param1, T param2) {
return true; return true;
} }
} // namespace name } // namespace name
/** /**
* @brief Self-test implementations * @brief Self-test implementations
@ -144,7 +146,7 @@ my_new_cpp_class.cpp is correct format
- It will be used to dynamically create a directory of files and implementation. - It will be used to dynamically create a directory of files and implementation.
- File name validation will run on Docker to ensure validity. - File name validation will run on Docker to ensure validity.
- If an implementation of the algorithm already exists and your version is different from that implemented, please use incremental numeric digit as a suffix. For example: if `median_search.cpp` already exists in the `search` folder, and you are contributing a new implementation, the filename should be `median_search2.cpp` and for a third implementation, `median_search3.cpp`. - If an implementation of the algorithm already exists and your version is different from that implemented, please use incremental numeric digit as a suffix. For example: if `median_search.cpp` already exists in the `search` folder, and you are contributing a new implementation, the filename should be `median_search2.cpp`. For a third implementation, `median_search3.cpp`, and so on.
#### New Directory guidelines #### New Directory guidelines
@ -175,7 +177,8 @@ Examples of commit messages with semantic prefixes:
fix: xyz algorithm bug fix: xyz algorithm bug
feat: add xyx algorithm, class xyz feat: add xyx algorithm, class xyz
test: add test for xyz algorithm test: add test for xyz algorithm
docs: add comments and explanation to xyz algorithm docs: add comments and explanation to xyz algorithm/improve contributing guidelines
chore: update Gitpod badge
``` ```
Common prefixes: Common prefixes:
@ -184,6 +187,7 @@ Common prefixes:
- feat: A new feature - feat: A new feature
- docs: Documentation changes - docs: Documentation changes
- test: Correct existing tests or add new ones - test: Correct existing tests or add new ones
- chore: Miscellaneous changes that do not match any of the above.
### Pull Requests ### Pull Requests