Skip to content

Commit 0ec45e3

Browse files
authored
Merge branch 'master' into aminos
2 parents 1b1eea7 + a6bd936 commit 0ec45e3

26 files changed

+2849
-215
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

-33
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Bug report
2+
description: Create a report to help us improve. Report bugs found while using the project
3+
title: "[BUG]"
4+
labels: [bug]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: "Provide a general summary of the issue in the Title above"
9+
- type: textarea
10+
id: description
11+
attributes:
12+
label: Description
13+
description: Provide a general summary of the issue in the Title above
14+
validations:
15+
required: true
16+
- type: input
17+
id: expectedbhv
18+
attributes:
19+
label: Expected behavior
20+
description: Tell us what should happen
21+
validations:
22+
required: true
23+
- type: input
24+
id: actualbhv
25+
attributes:
26+
label: Actual behavior
27+
description: Tell us what happens instead
28+
validations:
29+
required: true
30+
- type: input
31+
id: possiblefix
32+
attributes:
33+
label: Possible fix
34+
description: Not obligatory, but suggest a fix or reason for the bug
35+
validations:
36+
required: false
37+
- type: textarea
38+
id: steps
39+
attributes:
40+
label: Steps to reproduce
41+
description: |
42+
Provide a link to a live example, or an unambiguous set of steps to
43+
reproduce this bug. Include code to reproduce, if relevant
44+
placeholder: |
45+
1.
46+
2.
47+
3.
48+
4.
49+
validations:
50+
required: true
51+
- type: textarea
52+
id: context
53+
attributes:
54+
label: Context
55+
description: How has this bug affected you? What were you trying to accomplish?
56+
validations:
57+
required: true
58+
- type: textarea
59+
id: extrainformation
60+
attributes:
61+
label: Additional information
62+
description: Is there anything else we should know about this bug?
63+
validations:
64+
required: false

.github/ISSUE_TEMPLATE/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false

.github/ISSUE_TEMPLATE/feature_request.md

-20
This file was deleted.
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Feature request
2+
description: Suggest features, propose improvements, discuss new ideas.
3+
title: "[FEATURE]"
4+
labels: [enhancement]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: Provide a general summary of the issue in the Title above
9+
- type: textarea
10+
id: description
11+
attributes:
12+
label: Detailed description
13+
description: Provide a detailed description of the change or addition you are proposing
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: context
18+
attributes:
19+
label: Context
20+
description: |
21+
Why is this change important to you? How would you use it?
22+
How can it benefit other users?
23+
validations:
24+
required: true
25+
- type: textarea
26+
id: possibleimpl
27+
attributes:
28+
label: Possible implementation
29+
description: Not obligatory, but suggest an idea for implementing addition or change
30+
validations:
31+
required: false
32+
- type: textarea
33+
id: extrainformation
34+
attributes:
35+
label: Additional information
36+
description: Is there anything else we should know about this feature?
37+
validations:
38+
required: false

.github/ISSUE_TEMPLATE/other.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Other
2+
description: Use this for any other issues. Do NOT create blank issues
3+
title: "[OTHER]"
4+
labels: [triage]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: "# Other issue"
9+
- type: textarea
10+
id: issuedescription
11+
attributes:
12+
label: What would you like to share?
13+
description: Provide a clear and concise explanation of your issue.
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: extrainfo
18+
attributes:
19+
label: Additional information
20+
description: Is there anything else we should know about this issue?
21+
validations:
22+
required: false

CONTRIBUTING.md

+41-37
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,58 @@
22

33
## Before contributing
44

5-
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) and clearly state your concerns.
5+
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.
66

77
## Contributing
88

9+
### Maintainer/reviewer
10+
11+
**Please check the [reviewer code](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/REVIEWER_CODE.md) file for maintainers and reviewers.**
12+
913
### Contributor
1014

11-
We are very happy that you consider implementing algorithms and data structures for others! This repository is referred to and used by learners from around the globe. Being one of our contributors, you agree and confirm that:
15+
Being a contributor at The Algorithms, we request you to follow the points mentioned below:
1216

1317
- You did your own work.
1418
- No plagiarism allowed. Any plagiarized work will not be merged.
15-
- Your work will be distributed under [MIT License](License) once your pull request has been merged.
16-
- You submitted work fulfils or mostly fulfils our styles and standards.
19+
- 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.
20+
- Please follow the repository guidelines and standards mentioned below.
1721

18-
**New implementation** New implementation are welcome!
22+
**New implementation** New implementations are welcome!
1923

20-
**Improving comments** and **adding tests** to existing algorithms are much appreciated.
24+
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 resonable sense)
2125

22-
**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.
26+
**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.
2327

2428
### Making Changes
2529

2630
#### Code
2731

2832
- Please use the directory structure of the repository.
29-
- File extension for code should be `*.hpp`, `*.h` or `*.cpp`.
30-
- Don't use **bits/stdc++.h** because this is quite Linux specific and slows down the compilation process.
31-
- Organize your code using **`struct`**, **`class`** and/or **`namespace`** keywords
33+
- Make sure the file extensions should be `*.hpp`, `*.h` or `*.cpp`.
34+
- Don't use **`bits/stdc++.h`** because this is quite Linux-specific and slows down the compilation process.
35+
- Organize your code using **`struct`**, **`class`**, and/or **`namespace`** keywords
3236
- If an implementation of the algorithm already exists, please refer to the [file-name section below](#new-file-name-guidelines).
3337
- You can suggest reasonable changes to existing algorithms.
3438
- Strictly use snake_case (underscore_separated) in filenames.
3539
- If you have added or modified code, please make sure the code compiles before submitting.
36-
- Our automated testing runs [__CMake__](https://cmake.org/) on all pull requests so please be sure that your code passes before submitting.
37-
- 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 website.
38-
- **Be consistent in use of these guidelines.**
40+
- Our automated testing runs [__CMake__](https://cmake.org/) on all the pull requests, so please be sure that your code passes before submitting.
41+
- 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.
42+
- **Be consistent in the use of these guidelines.**
3943

4044
#### Documentation
4145

42-
- Make sure you put useful comments in your code. Do not comment things that are obvious.
46+
- Make sure you put useful comments in your code. Do not comment on obvious things.
4347
- Please avoid creating new directories if at all possible. Try to fit your work into the existing directory structure. If you want to create a new directory, then please check if a similar category has been recently suggested or created by other pull requests.
44-
- If you have modified/added documentation, please ensure that your language is concise and contains no grammar errors.
45-
- Do not update [`README.md`](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/README.md) along with other changes. First create an issue and then link to that issue in your pull request to suggest specific changes required to [`README.md`](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/README.md).
46-
- The repository follows [Doxygen](https://www.doxygen.nl/manual/docblocks.html) standards and auto-generates the [repository website](https://thealgorithms.github.io/C-Plus-Plus). Please ensure the code is documented in this structure. Sample implementation is given below.
48+
- If you have modified/added documentation, please ensure that your language is concise and must not contain grammatical errors.
49+
- Do not update [`README.md`](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/README.md) along with other changes. First, create an issue and then link to that issue in your pull request to suggest specific changes required to [`README.md`](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/README.md).
50+
- The repository follows [Doxygen](https://www.doxygen.nl/manual/docblocks.html) standards and auto-generates the [repository website](https://thealgorithms.github.io/C-Plus-Plus). Please ensure the code is documented in this structure. A sample implementation is given below.
4751

4852
#### Test
4953

50-
- Make sure to add examples and test cases in your main() function.
51-
- If you find any algorithm or document without tests, please feel free to create a pull request or issue describing suggested changes.
52-
- Please try to add one or more `test()` functions that will invoke the algorithm implementation on random test data with expected output. Use `assert()` function to confirm that the tests will pass. Requires including the `cassert` header.
54+
- Make sure to add examples and test cases in your `main()` function.
55+
- If you find an algorithm or document without tests, please feel free to create a pull request or issue describing suggested changes.
56+
- Please try to add one or more `test()` functions that will invoke the algorithm implementation on random test data with the expected output. Use the `assert()` function to confirm that the tests will pass. Requires including the `cassert` library.
5357

5458
#### Typical structure of a program
5559

@@ -58,23 +62,23 @@ We are very happy that you consider implementing algorithms and data structures
5862
* @file
5963
* @brief Add one line description here
6064
* @details
61-
* This is a multi line
65+
* This is a multi-line
6266
* description containing links, references,
63-
* math equations, etc
67+
* math equations, etc.
6468
* @author [Name](https://github.com/handle)
6569
* @see related_file.cpp, another_file.cpp
6670
*/
6771

68-
#include <cassert>
69-
#include
72+
#include <cassert> /// for assert
73+
#include /// for `some function here`
7074

7175
/**
7276
* @namespace <check from other files in this repo>
7377
*/
7478
namespace name {
7579

7680
/**
77-
* Class documentation
81+
* @brief Class documentation
7882
*/
7983
class class_name {
8084
private:
@@ -86,7 +90,7 @@ class class_name {
8690
}
8791

8892
/**
89-
* Function documentation
93+
* @brief Function documentation
9094
* @tparam T this is a one-line info about T
9195
* @param param1 on-line info about param1
9296
* @param param2 on-line info about param2
@@ -105,11 +109,11 @@ bool func(int param1, T param2) {
105109
} // namespace name
106110

107111
/**
108-
* @brief Test implementations
112+
* @brief Self-test implementations
109113
* @returns void
110114
*/
111115
static void test() {
112-
/* desciptions of the following test */
116+
/* descriptions of the following test */
113117
assert(func(...) == ...); // this ensures that the algorithm works as expected
114118

115119
// can have multiple checks
@@ -122,15 +126,15 @@ static void test() {
122126
* @returns 0 on exit
123127
*/
124128
int main(int argc, char *argv[]) {
125-
test(); // execute the tests
129+
test(); // run self-test implementations
126130
// code here
127131
return 0;
128132
}
129133
```
130134
131135
#### New File Name guidelines
132136
133-
- Use lowercase words with ``"_"`` as separator
137+
- Use lowercase words with ``"_"`` as a separator
134138
- For instance
135139
136140
```markdown
@@ -139,8 +143,8 @@ my_new_cpp_class.cpp is correct format
139143
```
140144

141145
- It will be used to dynamically create a directory of files and implementation.
142-
- File name validation will run on docker to ensure the validity.
143-
- 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`.
146+
- File name validation will run on Docker to ensure validity.
147+
- 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`.
144148

145149
#### New Directory guidelines
146150

@@ -158,7 +162,7 @@ some_new_fancy_category is correct
158162

159163
#### Commit Guidelines
160164

161-
- It is recommended to keep your changes grouped logically within individual commits. Maintainers find it easier to understand changes that are logically spilt across multiple commits. Try to modify just one or two files in the same directory. Pull requests that span multiple directories are often rejected.
165+
- It is recommended to keep your changes grouped logically within individual commits. Maintainers find it easier to understand changes that are logically spilled across multiple commits. Try to modify just one or two files in the same directory. Pull requests that span multiple directories are often rejected.
162166

163167
```bash
164168
git add file_xyz.cpp
@@ -196,15 +200,15 @@ cmake -B build -S .
196200

197201
#### Static Code Analyzer
198202

199-
We use [clang-tidy](https://clang.llvm.org/extra/clang-tidy/) as a static code analyzer with a configuration in [.clang-tidy](.clang-tidy).
203+
We use [`clang-tidy`](https://clang.llvm.org/extra/clang-tidy/) as a static code analyzer with a configuration in [`.clang-tidy`](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/.clang-tidy).
200204

201205
```bash
202206
clang-tidy --fix --quiet -p build subfolder/file_to_check.cpp --
203207
```
204208

205209
#### Code Formatter
206210

207-
[__clang-format__](https://clang.llvm.org/docs/ClangFormat.html) is used for code forrmating.
211+
[`__clang-format__`](https://clang.llvm.org/docs/ClangFormat.html) is used for code forrmating.
208212

209213
- Installation (only needs to be installed once.)
210214
- Mac (using home-brew): `brew install clang-format`
@@ -216,14 +220,14 @@ clang-tidy --fix --quiet -p build subfolder/file_to_check.cpp --
216220
#### GitHub Actions
217221

218222
- Enable GitHub Actions on your fork of the repository.
219-
After enabling it will execute `clang-tidy` and `clang-format` after every push (not a commit).
223+
After enabling, it will execute `clang-tidy` and `clang-format` after every push (not a commit).
220224
- Click on the tab "Actions", then click on the big green button to enable it.
221225

222226
![GitHub Actions](https://user-images.githubusercontent.com/51391473/94609466-6e925100-0264-11eb-9d6f-3706190eab2b.png)
223227

224228
- The result can create another commit if the actions made any changes on your behalf.
225229
- Hence, it is better to wait and check the results of GitHub Actions after every push.
226-
- Run `git pull` in your local clone if these actions made many changes in order to avoid merge conflicts.
230+
- Run `git pull` in your local clone if these actions made many changes to avoid merge conflicts.
227231

228232
Most importantly,
229233

0 commit comments

Comments
 (0)