Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #235 +/- ##
=======================================
Coverage 93.32% 93.32%
=======================================
Files 29 29
Lines 1843 1843
=======================================
Hits 1720 1720
Misses 123 123 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s Python formatting workflow to use Ruff’s formatter instead of Black, and re-applies formatting changes across the codebase alongside dependency / lockfile updates.
Changes:
- Replace
blackusage withruff format --checkincode_check.pyand remove Black config frompyproject.toml. - Update project config for Ruff/isort line length (120) and bump Ruff version in dev deps.
- Regenerate
uv.lock(including bumpingrequires-pythonto>=3.12and updating some resolved packages).
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Regenerated lockfile reflecting Ruff/Black swap, Python requirement bump, and dependency resolution changes |
pyproject.toml |
Removes Black config, updates Ruff/isort settings, bumps min Python + dependency constraints |
code_check.py |
Switches formatting step from Black to ruff format --check |
.github/workflows/ci.yml |
Updates Django matrix version (but still includes Python 3.11) |
test_runner/tests.py |
Minor whitespace cleanup consistent with formatter output |
test_runner/testapp/tests.py |
Formatting changes to assertions/ORM calls |
test_runner/settings.py |
String literal concatenation cleanup in help text strings |
dash/tags/models.py |
Removes stray blank line in class body |
dash/stories/models.py |
String literal concatenation cleanup in help text |
dash/orgs/views.py |
String literal concatenation cleanup in messages |
dash/orgs/models.py |
String literal concatenation cleanup + formatting of field definition |
dash/dashblocks/models.py |
String literal concatenation cleanup + one-line field formatting |
dash/categories/models.py |
One-line field formatting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| blank=True, | ||
| null=True, | ||
| help_text=_("A description of where this content type is used on the " "site and how it will be dsiplayed"), | ||
| help_text=_("A description of where this content type is used on the site and how it will be dsiplayed"), |
There was a problem hiding this comment.
Spelling in help text: "dsiplayed" should be "displayed".
| help_text=_("A description of where this content type is used on the site and how it will be dsiplayed"), | |
| help_text=_("A description of where this content type is used on the site and how it will be displayed"), |
| self.assertEqual( | ||
| kwargs, {"org": self.unicef, "uuid": "CF-002", "name": "Frank", "backend": self.floip_backend} | ||
| ) | ||
| self.assertEqual(kwargs, {"org": self.unicef, "uuid": "CF-002", "name": "Frank", "backend": self.floip_backend}) |
There was a problem hiding this comment.
This line looks inconsistent with the rest of the file’s formatting and may exceed the configured 120-char line length; ruff format --check (now enforced in code_check.py) may fail. Re-run ruff format and keep this assertion wrapped the way Ruff formats it.
| Contact.objects.get( | ||
| org=self.unicef, uuid="C-002", name="Franky", backend=self.rapidpro_backend, is_active=True | ||
| ) | ||
| Contact.objects.get(org=self.unicef, uuid="C-002", name="Franky", backend=self.rapidpro_backend, is_active=True) |
There was a problem hiding this comment.
This Contact.objects.get(...) call is now collapsed to a single long line; please re-run ruff format to ensure it matches Ruff’s formatter output (otherwise ruff format --check may fail in CI).
| matrix: | ||
| python-version: ["3.11.x", "3.12.x", "3.13.x"] | ||
| django-version: ["5.1.15", "5.2.9"] | ||
| django-version: ["5.1.15", "5.2.12"] |
There was a problem hiding this comment.
CI still runs Python 3.11 (matrix includes 3.11.x) even though this PR bumps requires-python to >=3.12 in pyproject.toml/uv.lock. This will fail uv sync/installs and also the release job still pins 3.11; update the workflow to only use supported Python versions (or revert the python requirement bump).
| requires-python = ">=3.12,<4.0" | ||
|
|
||
| dependencies = [ | ||
| "Django (>= 5.1.15,< 5.3)", | ||
| "celery[redis] ~= 5.5.3", | ||
| "django-compressor >= 4.0", | ||
| "django-timezone-field >= 6.1.0", | ||
| "Pillow >= 9.4", | ||
| "Pillow >= 12.1.1", | ||
| "phonenumbers >=8.12.16", | ||
| "psycopg >= 3.1.9", | ||
| "python-dateutil >=2.8.2", | ||
| "rapidpro-python (>=2.21.0,<3.0.0)", | ||
| "smartmin (>=5.2.2,<6.0.0)", | ||
| "smartmin (>=5.2.5,<6.0.0)", | ||
| "sorl-thumbnail >= 12.9.0", | ||
| "django-valkey (>=0.2.1,<0.3.0)", | ||
| ] |
There was a problem hiding this comment.
The PR title is about switching formatters (black -> ruff), but this also bumps the minimum Python version to 3.12 and updates runtime deps (e.g., Pillow, smartmin). If those changes aren’t required for the formatter switch, consider splitting them out (or documenting why the Python/dependency bumps are needed) to reduce upgrade risk for downstream consumers.
dash/orgs/views.py
Outdated
| messages.info( | ||
| request, | ||
| _("Your account is not associated to an " "organization. Please Contact the adminstrator."), | ||
| _("Your account is not associated to an organization. Please Contact the adminstrator."), |
There was a problem hiding this comment.
Spelling: the user-facing message says "adminstrator"; should be "administrator" (and consider lowercasing "Contact" if it’s not intentionally capitalized).
| _("Your account is not associated to an organization. Please Contact the adminstrator."), | |
| _("Your account is not associated to an organization. Please contact the administrator."), |
dash/dashblocks/models.py
Outdated
| help_text=_("The slug to idenfity this content type, used with the template tags"), | ||
| ) |
There was a problem hiding this comment.
Spelling in help text: "idenfity" should be "identify".
No description provided.