Skip to content

Commit c19c497

Browse files
committed
📚 Formatting: Adapt content for new package repo name
1 parent 0ed974c commit c19c497

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

‎docs/formatting.md‎

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ pip install ruff
4545
```
4646

4747
Let's see `ruff` in action!
48-
Have a look at the file `src/dev_tutorial/messy.py`:
48+
Have a look at the file `src/dev_tutorial_<YOUR_USERNAME>/messy.py`:
4949

5050
```python {.no-copy}
51-
# src/dev_tutorial/messy.py
51+
# src/dev_tutorial_<YOUR_USERNAME>/messy.py
5252
def calculate_statistics(data,include_median=True):
5353
"""Calculate statistics for a list of numbers."""
5454
debug_mode=True
@@ -76,14 +76,14 @@ This code has several formatting issues:
7676
Now run the formatter:
7777

7878
```
79-
ruff format src/dev_tutorial/messy_code.py
79+
ruff format
8080
```
8181

8282
```console {.no-copy}
83-
1 file reformatted
83+
1 file reformatted, 5 files left unchanged
8484
```
8585

86-
Open `src/dev_tutorial/messy.py` again and check how the code has changed.
86+
Open `src/dev_tutorial_<YOUR_USERNAME>/messy.py` again and check how the code has changed.
8787
`ruff` has automatically fixed all the formatting issues:
8888

8989
```python
@@ -114,12 +114,12 @@ But we still haven't checked the code for quality issues.
114114
Let's run the linter:
115115

116116
```
117-
ruff check src/dev_tutorial/messy_code.py
117+
ruff check
118118
```
119119

120120
```console {.no-copy}
121121
F841 Local variable `debug_mode` is assigned to but never used
122-
--> src/dev_tutorial/messy_code.py:3:5
122+
--> src/dev_tutorial_<YOUR_USERNAME>/messy_code.py:3:5
123123
|
124124
1 | def calculate_statistics(data, include_median=True):
125125
2 | """Calculate statistics for a list of numbers."""
@@ -148,6 +148,11 @@ After making these changes manually, run both commands again to verify everythin
148148
ruff format && ruff check
149149
```
150150

151+
```console {.no-copy}
152+
6 files left unchanged
153+
All checks passed!
154+
```
155+
151156
### Automating with pre-commit
152157

153158
Instead of remembering to run `ruff format` and `ruff check` before every commit, you can use `pre-commit` to automatically run these checks.
@@ -188,5 +193,7 @@ This ensures your code is always formatted and linted before it enters version c
188193

189194
---
190195

191-
You've set up local tools to check your code, but wouldn't it be nice if these checks ran automatically every time you push to GitHub? That's where Continuous Integration comes in!
196+
You've set up local tools to build & deploy documentation, run tests and check your code.
197+
Wouldn't it be nice if all this ran automatically every time you push to GitHub?
198+
That's where Continuous Integration comes in!
192199
**Next up: [Continuous Integration (CI)](ci.md)**

0 commit comments

Comments
 (0)