You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### 2. Test if your code corresponds to our style guide
49
49
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.
51
52
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.
55
54
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).
59
56
60
-
you can manually run pre-commit with `pre-commit run -a`.
57
+
#### Additional styles applied
61
58
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: ...`)
63
63
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
68
65
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.
70
67
71
-
#### Run mypy
68
+
#####Run ruff
72
69
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 .
75
75
```
76
76
77
-
###4. Ensure formatting is correct
77
+
##### Run mypy
78
78
79
-
#### Run ruff
79
+
Check your code with mypy to ensure that it follows the type-hinting rules.
0 commit comments