-
Notifications
You must be signed in to change notification settings - Fork 95
Contribution Guide
We welcome your contributions to dcrdex.
Development is coordinated via github issues and the Matrix DEX Development room. You can access the room at chat.decred.org, riot.im, or with any other Matrix client.
- Fork the repo.
- Create a branch for your work (
git checkout -b cool-stuff
). - Code something great.
- Commit and push to your forked repo.
- Create a pull request.
- Wrap comments after 80 columns, treating tabs as being 4 spaces wide. Trailing code comments are exempt.
- Try to keep code wrapped below 100 columns, but this is more of a guideline than a rule.
- Document all exported symbols. Use full sentences and proper punctuation.
- Justify the creation of exported types/variables/methods/functions. If it can be exported, it probably should be.
- Do not use
make
to allocate 0-capacity slices (e.g.make([]int, 0)
) unless you have a good reason. It is safe to append to anil
slice. - When declaring a variable with its zero value, just use
var
and not:=
. For example,var x int64
instead ofx := int64(0)
. - When defining
error
strings, avoid beginning with a capital letter unless it refers to an exported type or proper noun, and avoid ending with punctuation. There are exceptions, so this is not checked by a linter.
If your contribution is still in draft or a work-in-progress (WIP), create a draft pull request. Once your code is ready for review, click the links on the PR to make it ready for review.
When pushing updates to reviewable PRs, especially in response to reviews, ensure there is an easy way to see just what was changed since your previous revisions. Either add commits, which will be squash before merge, or force push your squashed branch without changing the merge-base so that when we view the "force-pushed" diff provided by Github, it shows only what was changed in your PR. If the merge-base changes, the diff will be mixed up with whatever else was changed on master, making it more difficult to review. You may force push subsequently to rebase.
If you are already a Decred contractor, you can charge for your development work on dcrdex. If you are not a Decred contractor but would like to be, you should first familiarize yourself with the onboarding process. dcrdex is a great place to get started, but you would be expected to take on only smaller jobs until you are comfortable navigating the code and have shown the ability to communicate and follow through.