From f9e5a25b36c143765da265e7d7e33e46bd9f3322 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 9 Nov 2021 07:48:25 +0000 Subject: [PATCH] Add docstring style to Contributing --- CONTRIBUTING.md | 7 +++++++ docs/developer.md | 2 ++ freqtrade/persistence/models.py | 2 ++ 3 files changed, 11 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c4ccc1b9f..b4e0bc024 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,6 +56,13 @@ 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). +##### Additional styles applied + +* Have docstrings on all public methods +* Use double-quotes for docstrings +* Multiline docstrings should be indented to the level of the first quote +* Doc-strings should follow the reST format (`:param xxx: ...`, `:return: ...`, `:raises KeyError: ... `) + ### 3. Test if all type-hints are correct #### Run mypy diff --git a/docs/developer.md b/docs/developer.md index 01f274131..b69a70aa3 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -26,6 +26,8 @@ Alternatively (e.g. if your system is not supported by the setup.sh script), fol This will install all required tools for development, including `pytest`, `flake8`, `mypy`, and `coveralls`. +Before opening a pull request, please familiarize yourself with our [Contributing Guidelines](https://github.com/freqtrade/freqtrade/blob/develop/CONTRIBUTING.md). + ### Devcontainer setup The fastest and easiest way to get started is to use [VSCode](https://code.visualstudio.com/) with the Remote container extension. diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index 61e59b7c3..df3b71acb 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -195,6 +195,8 @@ class Order(_DECL_BASE): @staticmethod def get_open_orders() -> List['Order']: """ + Retrieve open orders from the database + :return: List of open orders """ return Order.query.filter(Order.ft_is_open.is_(True)).all()