|
7 | 7 | 4. send a pull request to the `master` branch of this repository.
|
8 | 8 |
|
9 | 9 | ## Coding
|
10 |
| -1. **Style** - comply with **[PEP 8](https://www.python.org/dev/peps/pep-0008/)** and **[Wikimedia](https://www.mediawiki.org/wiki/Manual:Coding_conventions/Python)** conventions: |
11 |
| - - _4 spaces_ for indentation; |
12 |
| - - _snake-case_ style AKA _underscore_ as a word separator (files, variables, functions); |
13 |
| - - _UPPERCASE_ constants; |
14 |
| - - anything else is _lowercase_; |
15 |
| - - _2_ empty lines to separate functions; |
16 |
| - - _80_ characters per line, and up to _100_ when suitable; |
17 |
| - - _single-quoted_ strings, unless single-quotes are in a string. |
18 |
| -2. **[Type hints](https://docs.python.org/3/library/typing.html)** - add them at least to public function signatures; |
19 |
| -3. **Documentation** - write _[Sphinx](https://www.sphinx-doc.org/)_ docstrings at least for public functions and classes: |
20 |
| - - use [reST](https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html) markup; |
21 |
| - - stick to _[PEP 257](https://www.python.org/dev/peps/pep-0257/)_ and _[PEP 287](https://www.python.org/dev/peps/pep-0287/)_; |
22 |
| - - pay special attention to [info field lists](https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists); |
23 |
| - - [cross-reference](https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#cross-referencing-python-objects) Python objects. |
24 |
| -4. **Refactoring**: |
25 |
| - - fix _[pylint](https://www.pylint.org/)_ errors: `pylint -j 0 -E PATH_TO_YOUR_CONTRIBUTION`; |
26 |
| - - look at pylint warnings: `pylint -j 0 -d all -e W PATH_TO_YOUR_CONTRIBUTION`; |
27 |
| - - reduce complexity: `flake8 --select C90 --max-complexity 10 PATH_TO_YOUR_CONTRIBUTION`; |
28 |
| - - apply relevant refactoring suggestions: `pylint -j 0 -d all -e R PATH_TO_YOUR_CONTRIBUTION`. |
| 10 | + |
| 11 | +### Style |
| 12 | +Comply with **[PEP 8](https://www.python.org/dev/peps/pep-0008/)** and **[Wikimedia](https://www.mediawiki.org/wiki/Manual:Coding_conventions/Python)** conventions: |
| 13 | +- _4 spaces_ for indentation; |
| 14 | +- _snake-case_ style AKA _underscore_ as a word separator (files, variables, functions); |
| 15 | +- _UPPERCASE_ constants; |
| 16 | +- anything else is _lowercase_; |
| 17 | +- _2_ empty lines to separate functions; |
| 18 | +- _80_ characters per line, and up to _100_ when suitable; |
| 19 | +- _single-quoted_ strings, unless single-quotes are in a string. |
| 20 | + |
| 21 | +### Type Hints |
| 22 | +Add [type hints](https://docs.python.org/3/library/typing.html) at least to public function signatures. |
| 23 | + |
| 24 | +### Documentation |
| 25 | +Write _[Sphinx](https://www.sphinx-doc.org/)_ docstrings at least for public functions and classes: |
| 26 | +- use [reST](https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html) markup; |
| 27 | +- stick to _[PEP 257](https://www.python.org/dev/peps/pep-0257/)_ and _[PEP 287](https://www.python.org/dev/peps/pep-0287/)_; |
| 28 | +- pay special attention to [info field lists](https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists); |
| 29 | +- [cross-reference](https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#cross-referencing-python-objects) Python objects. |
| 30 | + |
| 31 | +### Refactoring |
| 32 | +- Fix _[pylint](https://www.pylint.org/)_ errors: `pylint -j 0 -E PATH_TO_YOUR_CONTRIBUTION`; |
| 33 | +- look at pylint warnings: `pylint -j 0 -d all -e W PATH_TO_YOUR_CONTRIBUTION`; |
| 34 | +- reduce complexity: `flake8 --select C90 --max-complexity 10 PATH_TO_YOUR_CONTRIBUTION`; |
| 35 | +- apply relevant refactoring suggestions: `pylint -j 0 -d all -e R PATH_TO_YOUR_CONTRIBUTION`. |
0 commit comments