on f80809a help sign in
Idris-dev/CONTRIBUTING.md
184 lines 8.0 kB history raw
1# Contributing to Idris-Dev
3The Idris Community welcomes pull requests, bug reporting, and bug squashing!
4However, we cannot do it all ourselves, and want to make it as easy as possible to contribute changes to get things working.
5Here are a few guidelines that we would like contributors to follow so that we can have a chance of keeping on top of things.
7## Getting Started
91. Make sure you are familiar with [Git](https://git-scm.com/book).
101. Make sure you have a [GitHub account](https://github.com/signup/free).
111. Make sure you are familiar with: [Idris](https://eb.host.cs.st-andrews.ac.uk/writings/idris-tutorial.pdf).
121. Make sure you can install Idris:
13 * [Mac OS X](https://github.com/idris-lang/Idris-dev/wiki/Idris-on-OS-X-using-Homebrew)
14 * [Ubuntu](https://github.com/idris-lang/Idris-dev/wiki/Idris-on-Ubuntu)
15 * [Debian](https://github.com/idris-lang/Idris-dev/wiki/Idris-on-Debian)
16 * [Windows](https://github.com/idris-lang/Idris-dev/wiki/Idris-on-Windows)
18## Issue Reporting
20Before you report an issue, or wish to add cool functionality please try and check to see if there are existing [issues](https://github.com/idris-lang/Idris-dev/issues) and [pull requests](https://github.com/idris-lang/Idris-dev/pulls).
21We do not want you wasting your time, duplicating somebody's work!
23### Template
24Try as closely as possible to describe the issue, ensuring that it has sections that match the following headings:
25> \# Steps to Reproduce
27> \# Expected Behavior
28>
29> \# Observed Behavior
30>
33In addition, please attach complete source files that exhibit the issue to quoting from them in the issue.
35### Feature Requests
36We would be delighted to receive feature requests only if they are feasible to implement and the author is willing to implement the suggested features themself. The current Idris developer team consists mostly of volunteers, and so it is unfortunately hard to accommodate implementing nice-to-have ideas that are not essential for core language development.
38## The Campsite Rule
40We try to follow the **campsite rule**: leave the code base in better condition than you found it.
41Please clean up any messes that you find, and don't leave behind new messes for the next contributor.
43## Contributing to the default libraries.
45Idris ships with a set of packages in `libs/` that is provided as a default library.
47+ `prelude` is a collection of basic definitions, automatically imported by Idris programs.
48+ `base` is tried and tested code that may be useful, and has seen active use in multiple projects.
49+ `contrib` is code that is experimental in design and that we want to test before possible inclusion in `base`.
50+ `effects` is a library which supports effectful programming.
52These packages should not be seen as the *standard* as when working with dependent types; we do not necessarily know how best to work with dependent types yet.
53These packages offer functionality that can be built on top of when constructing Idris programs.
55Everything in prelude will be imported automatically, unless given the `--noprelude` option.
56The contents of base are available with no special options, but modules must be imported.
57The other two packages that ship with Idris, contrib and effects, require the use of the `-p` command-line argument to bring their contents into the include path.
59New contributions should be added to the contrib package (never directly to base or prelude!).
60If they turn out to be widely applicable and useful, they may later be moved into base.
62As Idris is still being developed we are open to suggestions and changes that make improvements to these default packages.
63Major changes to the library, or Idris itself, should be discussed first through the project's official channels of communication:
651. The mailing List.
661. On our IRC Channel `#idris` on freenode, or
671. As an RFC in the issue tracker
69Developers then seeking to add content to Idris's prelude and default library, should do so through a PR where more discussions and refinements can be made.
71We do not want you wasting your time nor duplicating somebody's work!
73## Making Changes
75Idris developers and hackers try to adhere to something similar to the [successful git branching model](https://nvie.com/posts/a-successful-git-branching-model/).
76The steps are described below.
78### New contributors
80For those new to the project:
821. Fork our [main development repository](https://github.com/idris-lang/Idris-dev) `idris-dev` on github e.g.
832. Clone your fork to your local machine:
85```
86$ git clone git@github.com:<your github user name>/Idris-dev.git
87```
893. Add `idris-lang/Idris-dev` as a remote upstream
91```
92$ git remote add upstream git@github.com:idris-lang/Idris-dev.git
93```
95### Existing Contributors
97For those already contributing to the project:
991. Ensure your existing clone is up-to-date with current `HEAD` e.g.
101```
102$ git fetch upstream
103$ git merge upstream/master
104```
106### Remaining Steps
108The remaining steps are the same for both new and existing contributors:
1101. Create, and checkout onto, a topic branch on which to base you work.
111 * This is typically the master branch.
112 * Please avoid working on the `master` branch.
114```
115$ git branch fix/master/my_contrib master
116$ git checkout fix/master/my_contrib
117```
1191. Make commits of logical units.
1201. Check for unnecessary whitespace with
122```
123$ git diff --check
124```
1261. Make sure your commit messages are along the lines of:
128 Short (50 chars or less) summary of changes
130 More detailed explanatory text, if necessary. Wrap it to about 72
131 characters or so. In some contexts, the first line is treated as the
132 subject of an email and the rest of the text as the body. The blank
133 line separating the summary from the body is critical (unless you omit
134 the body entirely); tools like rebase can get confused if you run the
135 two together.
137 Further paragraphs come after blank lines.
139 - Bullet points are okay, too
141 - Typically a hyphen or asterisk is used for the bullet, preceded by a
142 single space, with blank lines in between, but conventions vary here
1441. Make sure you have added any necessary tests for your changes.
1451. Run all the tests to ensure nothing else was accidentally broken.
147```
148$ make test
149```
1511. Push your changes to a topic branch in your fork of the repository.
153```
154$ git push origin fix/master/my_contrib
155```
1571. Go to GitHub and submit a pull request to `idris-dev`
159From there you will have to wait on one of the `idris-dev` committers to respond to the request.
160This response might be an accept or some changes/improvements/alternatives will be suggest.
161We do not guarantee that all requests will be accepted.
163## Increasing chances of acceptance.
165To help increase the chance of your pull request being accepted:
1671. Run the tests.
1681. Update the documentation, the surrounding code, examples elsewhere, guides, whatever is affected by your contribution
1691. Use appropriate code formatting for both Idris and Haskell.
171## Additional Resources
173* [Idris Wiki](https://github.com/idris-lang/Idris-dev/wiki);
174* [Zen Of Idris](https://github.com/idris-lang/Idris-dev/wiki/The-Zen-of-Idris);
175* Idris FAQs: [Official](https://idris.readthedocs.io/en/latest/faq/faq.html); [Unofficial](https://github.com/idris-lang/Idris-dev/wiki/Unofficial-FAQ);
176* [Idris Manual](https://github.com/idris-lang/Idris-dev/wiki/Manual);
177* [Idris Tutorial](https://idris.readthedocs.io/en/latest/tutorial/index.html);
178* [Idris News](https://www.idris-lang.org/news/);
179* [other Idris docs](https://www.idris-lang.org/documentation/).
180* [Using Pull Requests](https://help.github.com/articles/using-pull-requests)
181* [General GitHub Documentation](https://help.github.com/).
184Adapted from the most excellent contributing files from the [Puppet project](https://github.com/puppetlabs/puppet) and [Factory Girl Rails](https://github.com/thoughtbot/factory_girl_rails/blob/master/CONTRIBUTING.md)