Skip to content

Commit d9d1c1e

Browse files
authored
Merge pull request #99 from GeriLife/upgrade-pre-commit
Update pre-commit hooks and improve code readability
2 parents 5d83044 + 568ea2b commit d9d1c1e

File tree

13 files changed

+60
-59
lines changed

13 files changed

+60
-59
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ target/
8080
profile_default/
8181
ipython_config.py
8282

83-
# pyenv
84-
.python-version
85-
8683
# pipenv
8784
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
8885
# However, in case of collaboration, if having platform-specific dependencies or dependencies

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-yaml
66
- id: end-of-file-fixer
@@ -11,12 +11,12 @@ repos:
1111
- id: check-toml
1212
- id: check-merge-conflict
1313
- repo: https://github.com/asottile/pyupgrade
14-
rev: v3.15.0
14+
rev: v3.19.1
1515
hooks:
1616
- id: pyupgrade
17-
args: [--py311-plus]
17+
args: [--py312-plus]
1818
- repo: https://github.com/adamchainz/django-upgrade
19-
rev: 1.15.0
19+
rev: 1.23.1
2020
hooks:
2121
- id: django-upgrade
2222
args: [--target-version, "4.2"]
@@ -28,7 +28,7 @@ repos:
2828
exclude: ".*migrations/.*"
2929
- repo: https://github.com/astral-sh/ruff-pre-commit
3030
# Ruff version.
31-
rev: v0.1.5
31+
rev: v0.11.0
3232
hooks:
3333
# Run the linter.
3434
- id: ruff
@@ -46,11 +46,11 @@ repos:
4646
hooks:
4747
- id: docformatter
4848
- repo: https://github.com/rtts/djhtml
49-
rev: 3.0.6
49+
rev: 3.0.7
5050
hooks:
5151
- id: djhtml
5252
- repo: https://github.com/pre-commit/mirrors-prettier
53-
rev: v3.1.0
53+
rev: v4.0.0-alpha.8
5454
hooks:
5555
- id: prettier
5656
types_or:
@@ -61,7 +61,7 @@ repos:
6161
- scss
6262
- yaml
6363
- repo: https://github.com/google/keep-sorted
64-
rev: v0.2.0
64+
rev: v0.6.0
6565
hooks:
6666
- id: keep-sorted
6767
exclude: ".*migrations/.*"

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ In essence, GeriLife is more than just a software tool; it's a commitment to enh
4040

4141
GeriLife is created by co-founders Brylie Christopher Oxley and Marjo-Riitta Rikala. The following paragraphs describe a bit about the history of how we created GeriLife and the purposes it serves.
4242

43-
**A Volunteer's Insight**: Our journey with GeriLife began not in front of screens or keyboards but within the bustling environment of an institutional elder care facility. As a volunteer, Brylie engaged with residents, bringing them joy through simple activities like walks, music sessions, or group events. However, choosing which residents to invite often fell to the on-duty nurses, who, despite their best intentions, tended to select the more social or visible residents. This unintentional bias left a silent but significant portion of the community overlooked. It was here, amid the day-to-day activities, where a nurse sowed the seed of our project.
43+
**A Volunteer's Insight**: Our journey with GeriLife began not in front of screens or keyboards but within the bustling environment of an institutional elder care facility. As a volunteer, Brylie engaged with residents, bringing them joy through simple activities like walks, music sessions, or group events. However, choosing which residents to invite often fell to the on-duty nurses, who, despite their best intentions, tended to select the more social or visible residents. This unintentional bias left a silent but significant portion of the community overlooked. It was here, amid the day-to-day activities, where a nurse sowed the seed of our project.
4444

4545
**From Observation to Action**: In search of a solution, a nurse suggested Brylie use a small paper notebook to record the activities he facilitated —- names of the residents, the nature of the activity, dates, and other observations. This humble beginning, documenting activities in a notebook, gradually revealed a powerful narrative: the need for a coordinated approach to ensure every resident had equal opportunities for engagement and enrichment.
4646

core/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
1. Import the include() function: from django.urls import include, path
1414
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1515
"""
16+
1617
from django.contrib import admin
1718
from django.urls import include, path
1819
from django.views.generic.base import TemplateView

homes/charts.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,16 @@ def prepare_work_by_caregiver_role_and_type_charts(context: dict) -> dict:
246246
get_total_hours_by_role_and_work_type_with_percent(home.id)
247247
)
248248

249-
context[
250-
"work_percent_by_caregiver_role_and_type_chart"
251-
] = prepare_work_percent_by_caregiver_role_and_type_chart(
252-
work_by_caregiver_role_and_type_with_percent,
249+
context["work_percent_by_caregiver_role_and_type_chart"] = (
250+
prepare_work_percent_by_caregiver_role_and_type_chart(
251+
work_by_caregiver_role_and_type_with_percent,
252+
)
253253
)
254254

255-
context[
256-
"work_by_caregiver_role_and_type_chart"
257-
] = prepare_work_by_caregiver_role_and_type_chart(
258-
work_by_caregiver_role_and_type_with_percent,
255+
context["work_by_caregiver_role_and_type_chart"] = (
256+
prepare_work_by_caregiver_role_and_type_chart(
257+
work_by_caregiver_role_and_type_with_percent,
258+
)
259259
)
260260

261261
return context

homes/views.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,17 @@ def prepare_activity_charts(self, context):
117117
"""Prepare activity charts and add them to the template context."""
118118
home = context["home"]
119119

120-
context[
121-
"activity_counts_by_resident_and_activity_type_chart"
122-
] = prepare_activity_counts_by_resident_and_activity_type_chart(home)
120+
context["activity_counts_by_resident_and_activity_type_chart"] = (
121+
prepare_activity_counts_by_resident_and_activity_type_chart(home)
122+
)
123123

124-
context[
125-
"monthly_activity_hours_by_type_chart"
126-
] = prepare_monthly_activity_hours_by_type_chart(home)
124+
context["monthly_activity_hours_by_type_chart"] = (
125+
prepare_monthly_activity_hours_by_type_chart(home)
126+
)
127127

128-
context[
129-
"monthly_activity_hours_by_caregiver_role_chart"
130-
] = prepare_monthly_activity_hours_by_caregiver_role_chart(home)
128+
context["monthly_activity_hours_by_caregiver_role_chart"] = (
129+
prepare_monthly_activity_hours_by_caregiver_role_chart(home)
130+
)
131131

132132
return context
133133

@@ -141,9 +141,9 @@ def prepare_work_charts(self, context):
141141
home,
142142
)
143143

144-
context[
145-
"daily_work_percent_by_caregiver_role_and_type_chart"
146-
] = prepare_daily_work_percent_by_caregiver_role_and_type_chart(home)
144+
context["daily_work_percent_by_caregiver_role_and_type_chart"] = (
145+
prepare_daily_work_percent_by_caregiver_role_and_type_chart(home)
146+
)
147147

148148
context = prepare_work_by_caregiver_role_and_type_charts(context)
149149

manage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22
"""Django's command-line utility for administrative tasks."""
3+
34
import os
45
import sys
56

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description = "Caregiving visualization tool to promote wellness in elder-care c
55
authors = ["Brylie Christopher Oxley <[email protected]>"]
66
license = "EUPL-1.2"
77
readme = "README.md"
8+
requires-python = ">=3.12,<3.13"
89
dependencies = [
910
"crispy-bootstrap5>=2023.10,<2024.0",
1011
"django>=5.0,<6.0",

residents/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Resident(models.Model):
2424

2525
@property
2626
def full_name(self):
27-
return f"{ self.first_name } { self.last_initial }"
27+
return f"{self.first_name} {self.last_initial}"
2828

2929
class Meta:
3030
db_table = "resident"
@@ -121,7 +121,7 @@ class Meta:
121121
verbose_name_plural = _("residencies")
122122

123123
def __str__(self) -> str:
124-
return f"{ self.resident.full_name } - { self.home.name }"
124+
return f"{self.resident.full_name} - {self.home.name}"
125125

126126
def clean(self) -> None:
127127
"""Ensure residency is valid.

0 commit comments

Comments
 (0)