Skip to content

Commit d0546e9

Browse files
committed
chore: further restructuring to contributing guide
1 parent e9f414b commit d0546e9

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,41 +45,41 @@ pytest tests/test_<file_name>.py
4545
pytest tests/test_<file_name>.py::test_<method_name>
4646
```
4747

48-
### 2. Test if your code is PEP8 compliant
48+
### 2. Test if your code corresponds to our style guide
4949

50-
#### Run Ruff
50+
We receive a lot of code that fails preliminary CI checks.
51+
To help with that, we encourage contributors to install the git pre-commit hook that will let you know immediately when you try to commit code that fails these checks.
5152

52-
```bash
53-
ruff check .
54-
```
53+
You can manually run pre-commit with `pre-commit run -a` - or install the git hook with `pre-commit install` to have it run automatically on each commit.
5554

56-
We receive a lot of code that fails the `ruff` checks.
57-
To help with that, we encourage you to install the git pre-commit
58-
hook that will warn you when you try to commit code that fails these checks.
55+
Running `pre-commit run -a` will run all checks, including `ruff`, `mypy` and `codespell` (among others).
5956

60-
you can manually run pre-commit with `pre-commit run -a`.
57+
#### Additional styles applied
6158

62-
##### Additional styles applied
59+
- Have docstrings on all public methods
60+
- Use double-quotes for docstrings
61+
- Multiline docstrings should be indented to the level of the first quote
62+
- Doc-strings should follow the reST format (`:param xxx: ...`, `:return: ...`, `:raises KeyError: ...`)
6363

64-
* Have docstrings on all public methods
65-
* Use double-quotes for docstrings
66-
* Multiline docstrings should be indented to the level of the first quote
67-
* Doc-strings should follow the reST format (`:param xxx: ...`, `:return: ...`, `:raises KeyError: ... `)
64+
#### Manually run the individual checks
6865

69-
### 3. Test if all type-hints are correct
66+
The following sections describe how to run the individual checks that are running as part of the pre-commit hook.
7067

71-
#### Run mypy
68+
##### Run ruff
7269

73-
``` bash
74-
mypy freqtrade
70+
Check your code with ruff to ensure that it follows the style guide.
71+
72+
```bash
73+
ruff check .
74+
ruff format .
7575
```
7676

77-
### 4. Ensure formatting is correct
77+
##### Run mypy
7878

79-
#### Run ruff
79+
Check your code with mypy to ensure that it follows the type-hinting rules.
8080

8181
``` bash
82-
ruff format .
82+
mypy freqtrade
8383
```
8484

8585
## (Core)-Committer Guide

0 commit comments

Comments
 (0)