Skip to content

Add some more Ruff rules#805

Merged
ddabble merged 5 commits intomainfrom
add-more-ruff-rules
Mar 24, 2026
Merged

Add some more Ruff rules#805
ddabble merged 5 commits intomainfrom
add-more-ruff-rules

Conversation

@ddabble
Copy link
Member

@ddabble ddabble commented Mar 24, 2026

Proposed changes

Also fixed some disappearing "Translators:" comments + some missing translations (d526e56).

Review guidance

Checklist

(If any of the points are not relevant, mark them as checked, so that it's easy to see which points you've handled or not)

  • I've run makemigrations, makemessages and compilemessages
  • I've written tests that fail without these changes (if relevant/possible)
  • I've manually tested the website UI with different device layouts
    • Most common is to test with typical screen sizes for mobile (320-425 px), tablet (768 px) and desktop (1024+ px), which can easily be done with your browser's dev tools
  • I've manually tested with different users locally
    • This can be e.g. anonymous users (i.e. not being logged in), "normal" non-member users, members of different committees, and superusers
  • I've made sure that my code conforms to the code style guides
    • It's not intended that you read through this whole document, but that you get yourself an overview over its contents, and that you use it as a reference guide / checklist while taking a second look at your code before opening a pull request
  • I've attempted to minimize the number of common code smells
    • See the comment for the previous checkbox
  • I've added documentation
    • E.g. comments, docstrings, or in the README
  • I've added my changes to the "Unreleased" section of the changelog, together with a link to this PR
    • Mainly the changes that are of particular interest to users and/or developers, if any
  • I've added a "Deployment notes" section above and labelled the PR with has-deployment-notes
    • ...if anything out of the ordinary should be done when deploying these changes to the server (e.g. adding/removing an environment variable, manually creating/changing some objects, running a management command, etc.)
  • I've structured my commits reasonably

@make-bot make-bot bot added this to web Mar 24, 2026
@make-bot make-bot bot moved this to Ready for Review in web Mar 24, 2026
@ddabble ddabble force-pushed the add-more-ruff-rules branch from ac80e9c to 226207b Compare March 24, 2026 16:52
@ddabble ddabble force-pushed the add-more-ruff-rules branch from 226207b to 4b1f675 Compare March 24, 2026 17:51
@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 71.26437% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.00%. Comparing base (1fc5b58) to head (ee4db3d).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/checkin/views.py 0.00% 7 Missing ⚠️
src/checkin/api/views.py 0.00% 3 Missing ⚠️
src/web/management/commands/runserver.py 0.00% 3 Missing ⚠️
src/docs/views.py 81.81% 2 Missing ⚠️
src/make_queue/views/reservation.py 0.00% 2 Missing ⚠️
src/util/ckeditor_utils.py 0.00% 2 Missing ⚠️
src/dataporten/views.py 0.00% 1 Missing ⚠️
src/mail/email.py 50.00% 1 Missing ⚠️
src/news/views/event.py 50.00% 1 Missing ⚠️
src/util/formfields.py 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #805      +/-   ##
==========================================
+ Coverage   87.98%   88.00%   +0.02%     
==========================================
  Files         153      153              
  Lines        6225     6246      +21     
==========================================
+ Hits         5477     5497      +20     
- Misses        748      749       +1     
Files with missing lines Coverage Δ
src/checkin/models.py 87.50% <100.00%> (+0.46%) ⬆️
src/contentbox/views.py 100.00% <100.00%> (ø)
src/internal/models.py 93.90% <100.00%> (+0.11%) ⬆️
src/internal/util.py 94.73% <100.00%> (+0.61%) ⬆️
src/make_queue/forms/course.py 82.35% <ø> (ø)
src/make_queue/forms/reservation.py 97.91% <100.00%> (ø)
src/make_queue/forms/reservation_rule.py 100.00% <100.00%> (ø)
src/make_queue/models/course.py 95.89% <ø> (ø)
src/news/forms.py 94.28% <100.00%> (ø)
src/news/models.py 98.15% <100.00%> (ø)
... and 22 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ddabble added 3 commits March 24, 2026 22:59
Did some refactoring to comply with its rules.
When wrapping a translation call (like `_()`) over multiple lines,
the `Translators:` comments apparently need to be inside the function
call to be inserted into the `.po` files.

Also added some missing translations.
@ddabble ddabble force-pushed the add-more-ruff-rules branch from 4b1f675 to ee4db3d Compare March 24, 2026 22:00
@ddabble
Copy link
Member Author

ddabble commented Mar 24, 2026

We've agreed to accept these PRs that mainly just adds linter rules, so merging without approval :)

@ddabble ddabble merged commit 4d8d244 into main Mar 24, 2026
11 checks passed
@ddabble ddabble deleted the add-more-ruff-rules branch March 24, 2026 22:08
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in web Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant