Skip to content

Commit 871150b

Browse files
pre-commit-ci[bot]fyliu
authored andcommitted
chore: pre-commit autoupdate
Updated hooks and auto-formatted.
1 parent a2e0469 commit 871150b

File tree

6 files changed

+43
-6
lines changed

6 files changed

+43
-6
lines changed

.pre-commit-config.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ repos:
4646
- id: hadolint
4747

4848
- repo: https://github.com/asottile/pyupgrade
49-
rev: v3.19.0
49+
rev: v3.19.1
5050
hooks:
5151
- id: pyupgrade
5252
args: [--py310-plus]
@@ -58,7 +58,7 @@ repos:
5858
args: [--target-version, "4.0"]
5959

6060
- repo: https://github.com/psf/black-pre-commit-mirror
61-
rev: 24.10.0
61+
rev: 25.1.0
6262
hooks:
6363
- id: black
6464
exclude: ^app/core/migrations/
@@ -93,14 +93,14 @@ repos:
9393
]
9494

9595
- repo: https://github.com/pycqa/isort
96-
rev: 5.13.2
96+
rev: 6.0.0
9797
hooks:
9898
- id: isort
9999
name: isort (python)
100100
args: ["--filter-files", "--force-single-line-imports"]
101101

102102
- repo: https://github.com/PyCQA/bandit
103-
rev: 1.8.0
103+
rev: 1.8.2
104104
hooks:
105105
- id: bandit
106106
exclude: ^app/core/tests/
@@ -124,7 +124,7 @@ repos:
124124

125125
- repo: https://github.com/astral-sh/ruff-pre-commit
126126
# Ruff version.
127-
rev: v0.8.1
127+
rev: v0.9.4
128128
hooks:
129129
# Run the linter.
130130
- id: ruff
@@ -135,7 +135,7 @@ repos:
135135
exclude: ^app/core/migrations/
136136

137137
- repo: https://github.com/executablebooks/mdformat
138-
rev: 0.7.19
138+
rev: 0.7.22
139139
hooks:
140140
- id: mdformat
141141
exclude: |

docs/contributing/dev_environment.md

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Set up two-factor authentication on your account by following this [guide](https
1919
Before cloning your forked repository to your local machine, you must have Git installed. You can find instructions for installing Git for your operating system [**here**](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
2020

2121
=== "Windows"
22+
2223
- we recommend [installing Windows Subsystem for Linux (WSL)](https://code.visualstudio.com/docs/remote/wsl). WSL provides a Linux-compatible environment that can prevent common errors during script execution.
2324

2425
- After setting up WSL, install Git directly from the Linux terminal. This method can help avoid complications that sometimes arise when using Git Bash on Windows.
@@ -32,6 +33,7 @@ Before cloning your forked repository to your local machine, you must have Git i
3233
!!! tip "Feel free to reach out in the [Hack for LA Slack channel](https://hackforla.slack.com/messages/people-depot/) if you encounter any errors while running scripts on Windows"
3334

3435
=== "Mac"
36+
3537
Please note that if you have a Mac the page offers several options (see other option, if you need to conserve hard drive space) including:
3638

3739
- an “easiest” option (this version is fine for our use): This option would take just over 4GB.
@@ -61,6 +63,7 @@ You can fork the hackforla/peopledepot repository by clicking <a href="https://g
6163
. A fork is a copy of the repository that will be placed on your GitHub account.
6264

6365
!!! note "It should create a URL that looks like the following -> `https://github.com/<your_GitHub_user_name>/peopledepot`"
66+
6467
!!! example "For example -> `https://github.com/octocat/peopledepot`"
6568

6669
!!! info "What you have created is a forked copy in a remote version on GitHub. It is not on your local machine yet"
@@ -132,13 +135,15 @@ upstream https://github.com/hackforla/peopledepot.git (push)
132135
1. Make sure the Docker service is running
133136

134137
=== "Docker (Engine)"
138+
135139
```bash
136140
sudo systemctl status docker
137141
```
138142

139143
It will show `Active: active (running)` if it's running.
140144
141145
=== "Docker Desktop"
146+
142147
1. Start Docker Desktop
143148
1. Run `docker container ls` to verify Docker Desktop is running. If it is not running you will get the message: `Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?`
144149

docs/contributing/howto/add-model-and-api-endpoints.md

+13
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This guide aims to enable developers with little or no django experience to add django models and API endpoints to the project. Most code examples are followed by detailed explanations.
44

55
??? note "The developer will have exposure to the following in this document"
6+
67
- python
78
- django
89
- django rest framework
@@ -22,6 +23,7 @@ Let's start!
2223
## Data model
2324

2425
??? note "TDD test"
26+
2527
1. Write the test
2628

2729
We would like the model to store these data, and to return the name property in the str function.
@@ -117,6 +119,7 @@ class RecurringEvent(AbstractBaseModel): # (1)!
117119
1. Always override the `__str__` function to output something more meaningful than the default. It lets us do a quick test of the model by calling `str([model])`. It's also useful for the admin site model list view.
118120

119121
??? note "Updating models.py for many-to-many relationships"
122+
120123
For adding many-to-many relationships with additional fields, such as `ended_on`, we can add
121124

122125
```python title="app/core/models.py" linenums="1"
@@ -165,6 +168,7 @@ This generates the database migration files
165168
```
166169

167170
??? note "Test"
171+
168172
Since we overrode the `__str__` function, we need to write a test for it.
169173

170174
1. Add a fixture for the model
@@ -212,6 +216,7 @@ This generates the database migration files
212216
```
213217

214218
??? note "Check and commit"
219+
215220
This is a good place to pause, check, and commit progress.
216221

217222
1. Run pre-commit checks
@@ -274,11 +279,13 @@ Check that everything's working and there are no issues, which should be the cas
274279
1. Having a misconfigured or buggy custom field could cause the admin site to crash and the developer will need to look at the debug message and resolve it.
275280

276281
??? note "Test"
282+
277283
1. Feel free to write tests for the admin. There's no example for it yet.
278284
1. The reason there's no tests is that the admin site is independent of the API functionality, and we're mainly interested in the API part.
279285
1. When the time comes that we depend on the admin interface, we will need to have tests for the needed functionalities.
280286

281287
??? note "Check and commit"
288+
282289
This is a good place to pause, check, and commit progress.
283290

284291
1. Run pre-commit checks
@@ -305,6 +312,7 @@ This is code that serializes objects into strings for the API endpoints, and des
305312
In `app/core/api/serializers.py`
306313

307314
??? note "Updating serializers.py for many-to-many relationships"
315+
308316
Following the many-to-many relationship between project and recurring event from above,
309317

310318
Update the existing serializer classes
@@ -458,6 +466,7 @@ In `app/core/api/views.py`
458466
1. It doesn't control permissions the way we want, but we will fix it later.
459467

460468
??? note "Extended example: Query Params"
469+
461470
This example shows how to add a filter params. It's done for the [user model](https://github.com/hackforla/peopledepot/issues/15) as a [requirement](https://github.com/hackforla/peopledepot/issues/10) from VRMS.
462471

463472
1. Here's a more complex API doc example (this example is using the User model's ViewSet)
@@ -565,6 +574,7 @@ In `app/core/api/urls.py`
565574
- `reverse("recurring-event-list")` would return `http://localhost:8000/api/v1/recuring-events/`
566575
567576
??? note "Test"
577+
568578
For the CRUD operations, since we're using `ModelViewSet` where all the actions are provided by `rest_framework` and well-tested, it's not necessary to have test cases for them. But here's an example of one.
569579
570580
In `app/core/tests/test_api.py`
@@ -610,6 +620,7 @@ In `app/core/api/urls.py`
610620
```
611621
612622
??? note "Test many-to-many relationships"
623+
613624
In `app/core/tests/test_api.py`
614625
615626
1. Import API URL
@@ -649,6 +660,7 @@ In `app/core/api/urls.py`
649660
```
650661
651662
??? note "Check and commit"
663+
652664
This is a good place to pause, check, and commit progress.
653665
654666
1. Run pre-commit checks
@@ -665,4 +677,5 @@ In `app/core/api/urls.py`
665677
```
666678
667679
??? note "Push the code and start a PR"
680+
668681
Refer to the [Issues page section on "Push to upstream origin"](issues.md#push-to-upstream-origin-aka-your-fork) onward.

docs/contributing/team.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ This step is optional if this is your first time fixing an issue and you want to
55
In the [People-depot Slack channel](https://hackforla.slack.com/messages/people-depot/), send an introductory message with your GitHub `handle/username` asking to be added to the Hack for LA peopledepot GitHub repository, have access to the Google Docs Drive, and Figma.
66

77
!!! note "Please do the following once you have accepted the GitHub invite (comes via email or in your GitHub notifications)"
8+
89
Make your own Hack for LA GitHub organization membership public by following this [guide](https://help.github.com/en/articles/publicizing-or-hiding-organization-membership#changing-the-visibility-of-your-organization-membership).

docs/contributing/tools/docker.md

+3
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ To restore a database to its original state and remove any data manually added,
2828
From Docker:
2929

3030
=== "Terminal"
31+
3132
```bash
3233
docker-compose down -v
3334
```
3435

3536
=== "Docker Desktop"
37+
3638
1. Open Containers section
3739
1. Delete people-db-1 container
3840
1. Open Images Tab
@@ -57,6 +59,7 @@ For apk, the cache directory is `/var/cache/apk/`. [APK wiki on local cache](htt
5759
For apt, the cache directory is `/var/cache/apt/`.
5860

5961
??? info "References"
62+
6063
- [buildkit mount the cache](https://vsupalov.com/buildkit-cache-mount-dockerfile/)
6164
- [proper usage of mount cache](https://dev.doroshev.com/blog/docker-mount-type-cache/)
6265
- [mount cache reference](https://docs.docker.com/engine/reference/builder/#run---mounttypecache)

docs/contributing/tools/mkdocs.md

+15
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Here's a list of commonly used MkDocs syntax for quick reference.
3333
### [Code Blocks](https://squidfunk.github.io/mkdocs-material/reference/code-blocks/)
3434

3535
=== "Example"
36+
3637
```python title="Code Block"
3738
@admin.register(RecurringEvent)
3839
class RecurringEventAdmin(admin.ModelAdmin):
@@ -64,6 +65,7 @@ Here's a list of commonly used MkDocs syntax for quick reference.
6465
```
6566

6667
=== "Code"
68+
6769
````
6870
```python title="Code Block"
6971
@admin.register(RecurringEvent)
@@ -99,13 +101,15 @@ Here's a list of commonly used MkDocs syntax for quick reference.
99101
### [Code Annotations](https://squidfunk.github.io/mkdocs-material/reference/annotations/)
100102

101103
=== "Example"
104+
102105
```bash
103106
Click the plus sign --> # (1)!
104107
```
105108

106109
1. This is an explanation text
107110

108111
=== "Code"
112+
109113
````
110114
``` bash
111115
Click the plus sign --> # (1)!
@@ -117,18 +121,23 @@ Here's a list of commonly used MkDocs syntax for quick reference.
117121
### [Text blocks](https://facelessuser.github.io/pymdown-extensions/extensions/blocks/plugins/details/)
118122

119123
=== "Example"
124+
120125
!!! example "Simple Block"
121126

122127
!!! example
128+
123129
Content Block Text
124130

125131
??? example "Expandable Block"
132+
126133
Content
127134

128135
???+ example "Opened Expandable Block"
136+
129137
Content
130138

131139
=== "Code"
140+
132141
```
133142
!!! example "Simple Block"
134143

@@ -145,13 +154,17 @@ Here's a list of commonly used MkDocs syntax for quick reference.
145154
### [Tabbed content](https://facelessuser.github.io/pymdown-extensions/extensions/tabbed/)
146155

147156
=== "Example"
157+
148158
=== "Linux"
159+
149160
linux-specific content
150161

151162
=== "Mac"
163+
152164
mac-specific content
153165

154166
=== "Code"
167+
155168
```
156169
=== "Linux"
157170

@@ -165,9 +178,11 @@ Here's a list of commonly used MkDocs syntax for quick reference.
165178
### [Buttons](https://squidfunk.github.io/mkdocs-material/reference/buttons/)
166179

167180
=== "Example"
181+
168182
1. ++ctrl+c++ to quit the local server and stop the container
169183

170184
=== "Code"
185+
171186
```
172187
1. ++ctrl+c++ to quit the local server and stop the container
173188
```

0 commit comments

Comments
 (0)