Skip to content

Commit 1a9cfe3

Browse files
committed
Add contributing guidelines
1 parent 31141da commit 1a9cfe3

File tree

1 file changed

+65
-9
lines changed

1 file changed

+65
-9
lines changed

CONTRIBUTING.md

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,74 @@
33
> Project contribution guidelines.
44
55

6-
When contributing to this project,
6+
## Introduction
77

8-
* Read and understand the [Code of Conduct][code-of-conduct].
9-
* Read and understand the [licensing terms][license].
10-
* Read and understand the [style guides][style-guides].
8+
While this guide focuses on technical development, if you are looking to contribute to the project but are non-technical, you can still contribute! For example, you can contribute by filing issues, writing RFCs (feature requests), updating documentation, providing build and infrastructure support, offering [funding][patreon], and helping market and promote the project, among other things. Every bit helps, and we are grateful for your time and effort!
119

1210

11+
## Contributing
1312

14-
<!-- <links> -->
13+
Before contributing, be sure to
1514

16-
[code-of-conduct]: https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md
17-
[license]: https://github.com/stdlib-js/stdlib/blob/develop/LICENSE
18-
[style-guides]: https://github.com/stdlib-js/stdlib/blob/develop/docs/style-guides
15+
* read and understand the [Code of Conduct][stdlib-code-of-conduct].
16+
* read and understand the [licensing terms][stdlib-license].
17+
* read and understand the [style guides][stdlib-style-guides].
1918

20-
<!-- </links> -->
19+
For instructions on how to setup and configure your environment, be sure to
20+
21+
* read the [development guide][stdlib-development].
22+
23+
If you want to contribute a new package to stdlib, be sure to
24+
25+
* read the [package development guide][stdlib-docs].
26+
27+
Next, take a look around the project, noting the style and organization of documentation, tests, examples, benchmarks, and source implementations. Consistency is highly __prioritized__ within stdlib. Thus, the more you are able to match and adhere to project conventions and style, the more likely your contribution will be accepted. While we have done our best to automate linting and style guidelines, such automation is not perfect and cannot adequately capture the inevitable exceptions and nuance to many rules. In short, the more you study existing practice, the better prepared you will be to contribute to stdlib.
28+
29+
For modifications intended to be included in stdlib, create a new local branch.
30+
31+
``` bash
32+
$ git checkout -b <branch>
33+
```
34+
35+
where `<branch>` is the branch name. Both the `master` and `develop` branches for the main stdlib project are protected, and direct modifications to these branches will __not__ be accepted. Instead, all contributions should be made on non-master and non-develop local branches, including documentation changes and other non-code modifications.
36+
37+
During development, to incorporate recent changes from the upstream repository, you should [rebase][git-rebase] your local branch, reapplying your local commits on top of the current upstream `HEAD`. This procedure is in contrast to performing a standard [merge][git-merge], which may interleave development histories. The rationale is twofold: 1) interleaved histories make [squashing][git-rewriting-history] commits more difficult and 2) a standard merge increases the risk of incomplete/broken commits appearing in the git history. An ideal commit history is one in which, at no point in time, is the project in a broken state. While not always possible (mistakes happen), striving for this ideal facilitates time travel and software archeology.
38+
39+
Before opening a [pull request][github-pull-request] on the upstream repository, run project tests to ensure that the changes introduced have not left the repository in a broken state.
40+
41+
``` bash
42+
$ make test
43+
$ make examples
44+
$ make benchmark
45+
```
46+
47+
Note that each of the above tasks can take considerable time (>30 minutes per task).
48+
49+
Once your contribution is ready to be incorporated in the upstream repository, open a [pull request][github-pull-request] against the `develop` branch. A project contributor will review the contribution, provide feedback, and potentially request changes. After any changes have been resolved and continuous integration tests have passed, a contributor will approve a [pull request][github-pull-request] for inclusion in the project.
50+
51+
Note that, once a [pull request][github-pull-request] has been made (i.e., your local repository commits have been pushed to a remote server), you should __not__ perform any further [rewriting][git-rewriting-history] of git history. If the history needs modification, a contributor will modify the history during the merge process. The rationale for __not__ rewriting public history is that doing so invalidates the commit history for anyone else who has pulled your changes, thus imposing additional burdens on collaborators to ensure that their local versions match the modified history.
52+
53+
Once merged, __congratulations__! You are an official contributor to stdlib!
54+
55+
Phew. While the above may be a lot to remember, even for what seem like minor changes, eventually it becomes routine and part of the normal development flow. Part of the motivation for enforcing process is to ensure that all code contributions meet a certain quality threshold, thus helping reviewers focus less on non-substantive issues like style and failing tests and more on substantive issues such as contribution content and merit. Know that your patience, hard work, time, and effort are greatly appreciated!
56+
57+
58+
<section class="links">
59+
60+
[stdlib-code-of-conduct]: https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md
61+
[stdlib-license]: https://github.com/stdlib-js/stdlib/blob/develop/LICENSE
62+
[stdlib-style-guides]: https://github.com/stdlib-js/stdlib/blob/develop/docs/style-guides
63+
[stdlib-development]: https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md
64+
[stdlib-docs]: https://github.com/stdlib-js/stdlib/blob/develop/docs
65+
66+
[patreon]: https://www.patreon.com/athan
67+
68+
[github-pull-request]: https://help.github.com/articles/creating-a-pull-request/
69+
70+
[git-rebase]: https://git-scm.com/docs/git-rebase
71+
[git-merge]: https://git-scm.com/docs/git-merge
72+
[git-rewriting-history]: https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
73+
74+
</section>
75+
76+
<!-- /.links -->

0 commit comments

Comments
 (0)