| 1 | # Contributing |
| 2 | |
| 3 | ## Contribute to freqtrade |
| 4 | |
| 5 | Feel like our bot is missing a feature? We welcome your pull requests! |
| 6 | |
| 7 | Issues labeled [good first issue](https://github.com/freqtrade/freqtrade/labels/good%20first%20issue) can be good first contributions, and will help get you familiar with the codebase. |
| 8 | |
| 9 | Few pointers for contributions: |
| 10 | |
| 11 | - Create your PR against the `develop` branch, not `stable`. |
| 12 | - New features need to contain unit tests, must conform to PEP8 (max-line-length = 100) and should be documented with the introduction PR. |
| 13 | - PR's can be declared as `[WIP]` - which signify Work in Progress Pull Requests (which are not finished). |
| 14 | |
| 15 | If you are unsure, discuss the feature on our [discord server](https://discord.gg/MA9v74M), on [Slack](https://join.slack.com/t/highfrequencybot/shared_invite/zt-mm786y93-Fxo37glxMY9g8OQC5AoOIw) or in a [issue](https://github.com/freqtrade/freqtrade/issues) before a PR. |
| 16 | |
| 17 | ## Getting started |
| 18 | |
| 19 | Best start by reading the [documentation](https://www.freqtrade.io/) to get a feel for what is possible with the bot, or head straight to the [Developer-documentation](https://www.freqtrade.io/en/latest/developer/) (WIP) which should help you getting started. |
| 20 | |
| 21 | ## Before sending the PR |
| 22 | |
| 23 | ### 1. Run unit tests |
| 24 | |
| 25 | All unit tests must pass. If a unit test is broken, change your code to |
| 26 | make it pass. It means you have introduced a regression. |
| 27 | |
| 28 | #### Test the whole project |
| 29 | |
| 30 | ```bash |
| 31 | pytest |
| 32 | ``` |
| 33 | |
| 34 | #### Test only one file |
| 35 | |
| 36 | ```bash |
| 37 | pytest tests/test_<file_name>.py |
| 38 | ``` |
| 39 | |
| 40 | #### Test only one method from one file |
| 41 | |
| 42 | ```bash |
| 43 | pytest tests/test_<file_name>.py::test_<method_name> |
| 44 | ``` |
| 45 | |
| 46 | ### 2. Test if your code is PEP8 compliant |
| 47 | |
| 48 | #### Run Flake8 |
| 49 | |
| 50 | ```bash |
| 51 | flake8 freqtrade tests scripts |
| 52 | ``` |
| 53 | |
| 54 | We receive a lot of code that fails the `flake8` checks. |
| 55 | To help with that, we encourage you to install the git pre-commit |
| 56 | hook that will warn you when you try to commit code that fails these checks. |
| 57 | Guide for installing them is [here](http://flake8.pycqa.org/en/latest/user/using-hooks.html). |
| 58 | |
| 59 | ### 3. Test if all type-hints are correct |
| 60 | |
| 61 | #### Run mypy |
| 62 | |
| 63 | ``` bash |
| 64 | mypy freqtrade |
| 65 | ``` |
| 66 | |
| 67 | ### 4. Ensure all imports are correct |
| 68 | |
| 69 | #### Run isort |
| 70 | |
| 71 | ``` bash |
| 72 | isort . |
| 73 | ``` |
| 74 | |
| 75 | ## (Core)-Committer Guide |
| 76 | |
| 77 | ### Process: Pull Requests |
| 78 | |
| 79 | How to prioritize pull requests, from most to least important: |
| 80 | |
| 81 | 1. Fixes for broken tests. Broken means broken on any supported platform or Python version. |
| 82 | 1. Extra tests to cover corner cases. |
| 83 | 1. Minor edits to docs. |
| 84 | 1. Bug fixes. |
| 85 | 1. Major edits to docs. |
| 86 | 1. Features. |
| 87 | |
| 88 | Ensure that each pull request meets all requirements in the Contributing document. |
| 89 | |
| 90 | ### Process: Issues |
| 91 | |
| 92 | If an issue is a bug that needs an urgent fix, mark it for the next patch release. |
| 93 | Then either fix it or mark as please-help. |
| 94 | |
| 95 | For other issues: encourage friendly discussion, moderate debate, offer your thoughts. |
| 96 | |
| 97 | ### Process: Your own code changes |
| 98 | |
| 99 | All code changes, regardless of who does them, need to be reviewed and merged by someone else. |
| 100 | This rule applies to all the core committers. |
| 101 | |
| 102 | Exceptions: |
| 103 | |
| 104 | - Minor corrections and fixes to pull requests submitted by others. |
| 105 | - While making a formal release, the release manager can make necessary, appropriate changes. |
| 106 | - Small documentation changes that reinforce existing subject matter. Most commonly being, but not limited to spelling and grammar corrections. |
| 107 | |
| 108 | ### Responsibilities |
| 109 | |
| 110 | - Ensure cross-platform compatibility for every change that's accepted. Windows, Mac & Linux. |
| 111 | - Ensure no malicious code is introduced into the core code. |
| 112 | - Create issues for any major changes and enhancements that you wish to make. Discuss things transparently and get community feedback. |
| 113 | - Keep feature versions as small as possible, preferably one new feature per version. |
| 114 | - Be welcoming to newcomers and encourage diverse new contributors from all backgrounds. See the Python Community Code of Conduct (https://www.python.org/psf/codeofconduct/). |
| 115 | |
| 116 | ### Becoming a Committer |
| 117 | |
| 118 | Contributors may be given commit privileges. Preference will be given to those with: |
| 119 | |
| 120 | 1. Past contributions to Freqtrade and other related open-source projects. Contributions to Freqtrade include both code (both accepted and pending) and friendly participation in the issue tracker and Pull request reviews. Quantity and quality are considered. |
| 121 | 1. A coding style that the other core committers find simple, minimal, and clean. |
| 122 | 1. Access to resources for cross-platform development and testing. |
| 123 | 1. Time to devote to the project regularly. |
| 124 | |
| 125 | Being a Committer does not grant write permission on `develop` or `stable` for security reasons (Users trust Freqtrade with their Exchange API keys). |
| 126 | |
| 127 | After being Committer for some time, a Committer may be named Core Committer and given full repository access. |