freqtrade_origin/CONTRIBUTING.md

72 lines
1.6 KiB
Markdown
Raw Normal View History

2018-09-12 18:24:19 +00:00
# Contributing
## Contribute to freqtrade
2018-01-02 02:17:10 +00:00
2017-12-22 12:29:31 +00:00
Feel like our bot is missing a feature? We welcome your pull requests! Few pointers for contributions:
- Create your PR against the `develop` branch, not `master`.
2018-01-02 02:17:10 +00:00
- New features need to contain unit tests and must be PEP8
2018-09-12 18:24:19 +00:00
2018-01-02 02:17:10 +00:00
conformant (max-line-length = 100).
2017-12-22 12:29:31 +00:00
If you are unsure, discuss the feature on our [Slack](https://join.slack.com/t/highfrequencybot/shared_invite/enQtMjQ5NTM0OTYzMzY3LWMxYzE3M2MxNDdjMGM3ZTYwNzFjMGIwZGRjNTc3ZGU3MGE3NzdmZGMwNmU3NDM5ZTNmM2Y3NjRiNzk4NmM4OGE)
or in a [issue](https://github.com/freqtrade/freqtrade/issues) before a PR.
2017-12-22 12:29:31 +00:00
2018-01-02 02:17:10 +00:00
**Before sending the PR:**
## 1. Run unit tests
2017-12-22 12:29:31 +00:00
2018-01-02 02:17:10 +00:00
All unit tests must pass. If a unit test is broken, change your code to
make it pass. It means you have introduced a regression.
2017-12-22 12:29:31 +00:00
2018-09-12 18:24:19 +00:00
### Test the whole project
2017-12-22 12:29:31 +00:00
```bash
pytest freqtrade
```
2018-09-12 18:24:19 +00:00
### Test only one file
2017-12-22 12:29:31 +00:00
```bash
pytest freqtrade/tests/test_<file_name>.py
```
2018-09-12 18:24:19 +00:00
### Test only one method from one file
2017-12-22 12:29:31 +00:00
```bash
2018-01-02 04:04:41 +00:00
pytest freqtrade/tests/test_<file_name>.py::test_<method_name>
2017-12-22 12:29:31 +00:00
```
2018-01-02 02:17:10 +00:00
## 2. Test if your code is PEP8 compliant
2018-09-12 18:24:19 +00:00
### Install packages
2017-12-22 12:29:31 +00:00
```bash
pip3.6 install flake8 coveralls
2018-09-12 18:24:19 +00:00
```
### Run Flake8
2017-12-22 12:29:31 +00:00
```bash
flake8 freqtrade
```
2018-06-11 11:50:24 +00:00
We receive a lot of code that fails the `flake8` checks.
To help with that, we encourage you to install the git pre-commit
hook that will warn you when you try to commit code that fails these checks.
Guide for installing them is [here](http://flake8.pycqa.org/en/latest/user/using-hooks.html).
## 3. Test if all type-hints are correct
2017-12-22 12:29:31 +00:00
2018-09-12 18:24:19 +00:00
### Install packages
``` bash
pip3.6 install mypy
```
2018-09-12 18:24:19 +00:00
### Run mypy
``` bash
mypy freqtrade
```