You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+33-42
Original file line number
Diff line number
Diff line change
@@ -2,66 +2,57 @@
2
2
3
3
## Before contributing
4
4
5
-
Welcome to [TheAlgorithms/C](https://github.com/TheAlgorithms/C)! 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/issues/new/choose) and clearly state your concerns.
5
+
Welcome to [TheAlgorithms/C](https://github.com/TheAlgorithms/C)! 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/issues/new/choose)or ask in our [Discord server](https://discord.gg/c7MnfGFGa6), and clearly state your concerns.
6
6
7
7
## Contributing
8
8
9
-
### Maintainer/developer
9
+
### Maintainer/reviewer
10
10
11
-
If you are a maintainer of this repository, please consider the following:
12
-
13
-
- It is a protocol to contribute via pull requests.
14
-
- Reviewers will advise and guide you up to make the code refined and documented.
15
-
- When reviewing pull requests, be sure to:
16
-
- Be kind.
17
-
- Be respectful.
18
-
- Make useful suggestions/comments.
19
-
- Be sure not to make invalid suggestions/comments.
20
-
- Guide and advise up the pull request author.
11
+
**Please check the [reviewer code](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/REVIEWER_CODE.md) file for maintainers and reviewers.**
21
12
22
13
### Contributor
23
14
24
-
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:
25
16
26
17
- You did your own work.
27
18
- No plagiarism allowed. Any plagiarized work will not be merged.
28
19
- Your work will be distributed under the [GNU General Public License v3.0](https://github.com/TheAlgorithms/C/blob/master/LICENSE) once your pull request has been merged.
29
-
-You submitted work fulfils or mostly fulfils our styles and standards.
20
+
-Please follow the repository guidelines and standards mentioned below.
30
21
31
-
**New implementation** New implementation are welcome!
22
+
**New implementation** New implementations are welcome!
32
23
33
-
**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)
34
25
35
-
**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.
36
27
37
28
### Making Changes
38
29
39
30
#### Code
40
31
41
32
- Please use the directory structure of the repository.
42
-
-File extension for code should be `*.h``*.c`
43
-
- Organize your code using **`struct`**keywords
33
+
-Make sure the file extensions should be `*.h``*.c`
34
+
- Organize your code using the **`struct`**keyword
44
35
- If an implementation of the algorithm already exists, please refer to the [file-name section below](#file-name-guidelines).
45
36
- You can suggest reasonable changes to existing algorithms.
46
37
- Strictly use snake_case (underscore_separated) in filenames.
47
38
- If you have added or modified code, please make sure the code compiles before submitting.
48
-
- Our automated testing runs [__CMake__](https://cmake.org/) on all pull requests so please be sure that your code passes before submitting.
49
-
- 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.
50
-
-**Be consistent in use of these guidelines.**
39
+
- Our automated testing runs [__CMake__](https://cmake.org/) on all the pull requests, so please be sure that your code passes before submitting.
40
+
- 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.
41
+
-**Be consistent in the use of these guidelines.**
51
42
52
43
#### Documentation
53
44
54
-
- Make sure you put useful comments in your code. Do not comment things that are obvious.
45
+
- Make sure you put useful comments in your code. Do not comment on obvious things.
55
46
- 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.
56
-
- If you have modified/added documentation, please ensure that your language is concise and contains no grammar errors.
57
-
- Do not update 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
58
-
- The repository follows [Doxygen](https://www.doxygen.nl/manual/docblocks.html) standards and auto-generates the [repository website](https://thealgorithms.github.io/C). Please ensure the code is documented in this structure. Sample implementation is given below.
47
+
- If you have modified/added documentation, please ensure that your language is concise and must not contain grammatical errors.
48
+
- Do not update [`README.md`](https://github.com/TheAlgorithms/C/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/blob/master/README.md).
49
+
- The repository follows [Doxygen](https://www.doxygen.nl/manual/docblocks.html) standards and auto-generates the [repository website](https://thealgorithms.github.io/C). Please ensure the code is documented in this structure. A sample implementation is given below.
59
50
60
51
#### Test
61
52
62
-
- Make sure to add examples and test cases in your main() function.
63
-
- If you find any algorithm or document without tests, please feel free to create a pull request or issue describing suggested changes.
64
-
- 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 adding the `assert.h` library.
53
+
- Make sure to add examples and test cases in your `main()` function.
54
+
- If you find an algorithm or document without tests, please feel free to create a pull request or issue describing suggested changes.
55
+
- 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 `assert.h` library.
65
56
66
57
#### Typical structure of a program
67
58
@@ -70,15 +61,15 @@ We are very happy that you consider implementing algorithms and data structures
70
61
* @file
71
62
* @brief Add one line description here
72
63
* @details
73
-
* This is a multiline
64
+
* This is a multi-line
74
65
* description containing links, references,
75
-
* math equations, etc
66
+
* math equations, etc.
76
67
* @author [Name](https://github.com/handle)
77
68
* @see related_file.c, another_file.c
78
69
*/
79
70
80
-
#include<assert.h>
81
-
#include
71
+
#include<assert.h>/// for assert
72
+
#include/// for `some function here`
82
73
83
74
/**
84
75
* @brief Struct documentation
@@ -89,7 +80,7 @@ struct struct_name {
89
80
};
90
81
91
82
/**
92
-
* Function documentation
83
+
* @brief Function documentation
93
84
* @param param1 one-line info about param1
94
85
* @param param2 one-line info about param2
95
86
* @returns `true` if ...
@@ -105,7 +96,7 @@ bool func(int param1, int param2) {
105
96
}
106
97
107
98
/**
108
-
*@briefTest function
99
+
*@briefSelf-test implementations
109
100
*@returns void
110
101
*/
111
102
static void test() {
@@ -120,15 +111,15 @@ static void test() {
120
111
*@returns 0 on exit
121
112
*/
122
113
int main() {
123
-
test(); // execute the tests
114
+
test(); // run self-test implementations
124
115
// code here
125
116
return 0;
126
117
}
127
118
```
128
119
129
120
#### File name guidelines
130
121
131
-
- Use lowercase words with ``"_"`` as separator
122
+
- Use lowercase words with ``"_"`` as a separator
132
123
- For instance
133
124
134
125
```markdown
@@ -137,8 +128,8 @@ my_new_c_struct.c is correct format
137
128
```
138
129
139
130
- It will be used to dynamically create a directory of files and implementation.
140
-
- File name validation will run on docker to ensure the validity.
141
-
- 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.c` already exists in the `search` folder and you are contributing a new implementation, the filename should be `median_search2.c` and for a third implementation, `median_search3.c`.
131
+
- File name validation will run on Docker to ensure validity.
132
+
- 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.c` already exists in the `search` folder, and you are contributing a new implementation, the filename should be `median_search2.c` and for a third implementation, `median_search3.c`.
142
133
143
134
#### Directory guidelines
144
135
@@ -156,7 +147,7 @@ some_new_fancy_category is correct
156
147
157
148
#### Commit Guidelines
158
149
159
-
- 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.
150
+
- 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.
0 commit comments