From f54bec041f64d58c7b4ca3377a1e841caf54af5f Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Sun, 15 Jun 2025 12:46:59 +0200 Subject: [PATCH] Info about code style --- CONTRIBUTING.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 83d136cd..94eaab8f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -153,3 +153,28 @@ To disable _Pylint_ rule in source code, the comment line in following format ca +## Code style + +### Docstrings style +We are using [Google's docstring style](https://google.github.io/styleguide/pyguide.html). + +Here is simple example: +```python +def function_with_pep484_type_annotations(param1: int, param2: str) -> bool: + """Example function with PEP 484 type annotations. + + Args: + param1: The first parameter. + param2: The second parameter. + + Returns: + The return value. True for success, False otherwise. + + Raises: + ValueError: If the first parameter does not contain proper model name + """ +``` + +For further guidance, see the rest of our codebase, or check sources online. There are many, eg. [this one](https://gist.github.com/redlotus/3bc387c2591e3e908c9b63b97b11d24e). + +