Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

# Keep in sync with the rev in .pre-commit-config.yaml
- name: Install ruff
run: python -m pip install ruff==0.15.20
run: python -m pip install ruff==0.17.4

- name: Ruff check
run: ruff check .
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Keep in sync with the version in .github/workflows/ci.yml
rev: v0.15.20
rev: v0.17.4
hooks:
- id: ruff
1 change: 1 addition & 0 deletions docs/ruff_fix_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ lint.per-file-ignores = { "tests/*" = [
> (`.github/workflows/ci.yml`), and `.pre-commit-config.yaml` provides a
> local hook (`pip install pre-commit && pre-commit install` to enable).
> Ruff is pinned to 0.15.20 in both places — bump them together.
> (Bumped to 0.17.4 on 2026-11-06; still zero findings.)
> Step 3 delivered: S113 timeout in log_poster, `utcnow()` →
> `datetime.now(UTC).replace(tzinfo=None)` in auth.py + notesync/service.py
> (kept naive-UTC storage semantics), tz-aware `now()` in weekly_metrics,
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tool.ruff]
# Explicit linter list (was `ALL`, frozen 2026-07-12 at ruff 0.15.20 with a
# clean `ruff check .`). New linters added by future ruff versions won't
# clean `ruff check .`; still clean at ruff 0.17.4, the version pinned in CI
# and pre-commit since 2026-11-06). New linters added by future ruff versions won't
# auto-enable; add them here deliberately. Framework linters that don't apply
# (AIR airflow, DJ django, FAST fastapi) and preview-only ones (CPY, DOC)
# are intentionally left out.
Expand Down
2 changes: 1 addition & 1 deletion src/safe_family/static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,7 @@ td form button {
}

.lotto-toolbar,
.lotto-row {
.lotto-actions {
display: flex;
flex-wrap: wrap;
align-items: center;
Expand Down
6 changes: 3 additions & 3 deletions src/safe_family/templates/lotto/lotto.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from straight above, the tray filling the frame, full resolution. Tilt the phone a little if a ceiling light
reflects on the glass. You can pick several photos at once. Upload whenever you like: photos wait in
<b>To label</b> until you have time, even for weeks.</p>
<div class="lotto-row">
<div class="lotto-actions">
<input type="file" id="lotto-photos" name="photos" accept="image/*,.heic,.heif" multiple hidden>
<label for="lotto-photos" class="btn btn-secondary lotto-btn">📷 Choose / take photos</label>
<span id="lotto-chosen" class="note lotto-chosen">No photos chosen</span>
Expand Down Expand Up @@ -77,11 +77,11 @@
<!-- Steps 3-4: Mac round trip -->
<div class="card lotto-mac">
<div class="lotto-step">3 · Train on the Mac &nbsp;·&nbsp; 4 · Bring predictions back</div>
<div class="lotto-row">
<div class="lotto-actions">
<a class="btn btn-secondary lotto-btn" href="{{ url_for('lotto.lotto_export', scope='labeled') }}">⬇️ Training set (.zip)</a>
<a class="btn btn-secondary lotto-btn" href="{{ url_for('lotto.lotto_export', scope='all') }}">⬇️ All photos, to pre-label (.zip)</a>
</div>
<form action="{{ url_for('lotto.lotto_predictions') }}" method="POST" enctype="multipart/form-data" class="lotto-row">
<form action="{{ url_for('lotto.lotto_predictions') }}" method="POST" enctype="multipart/form-data" class="lotto-actions">
<input type="file" id="lotto-preds" name="predictions" accept="application/json,.json" hidden>
<label for="lotto-preds" class="btn btn-secondary lotto-btn">📄 Choose predictions.json</label>
<span id="lotto-preds-chosen" class="note lotto-chosen">No file chosen</span>
Expand Down
6 changes: 3 additions & 3 deletions src/safe_family/templates/lotto/lotto_label.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<div class="lotto-editor">
<div class="card lotto-stage-card">
<div class="lotto-row">
<div class="lotto-actions">
<button type="button" class="btn btn-secondary lotto-btn" id="rot-left" title="Rotate left">⟲ 90°</button>
<button type="button" class="btn btn-secondary lotto-btn" id="rot-right" title="Rotate right">⟳ 90°</button>
<label class="lotto-dim">Zoom
Expand All @@ -40,7 +40,7 @@
<input type="hidden" name="rotation" id="f-rotation" value="{{ photo.rotation }}">
<input type="hidden" name="boxes" id="f-boxes">
<div class="lotto-step">Value for new boxes</div>
<div class="lotto-row" id="value-chips">
<div class="lotto-actions" id="value-chips">
{% for v in ticket_values %}
<button type="button" class="btn btn-secondary lotto-btn lotto-chipbtn" data-value="{{ v }}">${{ v }}</button>
{% endfor %}
Expand All @@ -63,7 +63,7 @@
<p class="lotto-help">Picked automatically (70/15/15). <b>test</b> photos are never trained on, so they give an
honest accuracy score. Leave it alone unless you know why.</p>

<div class="lotto-row">
<div class="lotto-actions">
<button type="submit" name="action" value="save_next" class="btn btn-primary lotto-btn">Save &amp; next ⏎</button>
<button type="submit" name="action" value="save" class="btn btn-secondary lotto-btn">Save</button>
{% if photo.skipped %}
Expand Down
14 changes: 14 additions & 0 deletions tests/test_lotto.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,3 +572,17 @@ def test_routes_redirect_when_user_missing(notesync_app, notesync_client):
response = getattr(notesync_client, method)(url)
assert response.status_code == 302, url
assert "/auth/login-ui" in response.headers["Location"]


def test_lotto_styles_leave_store_calculator_rows_alone():
# The Store Accounting calculator's table rows are <tr class="lotto-row">
# (its JS selects them by that class). A stylesheet rule on .lotto-row
# (e.g. display: flex) breaks that table, so the lotto pages use
# .lotto-actions for their button rows instead.
from pathlib import Path

root = Path(__file__).resolve().parent.parent / "src" / "safe_family"
css = (root / "static" / "css" / "styles.css").read_text()
assert ".lotto-row" not in css
calculator = (root / "templates" / "miscellaneous" / "store_calculator.html").read_text()
assert 'class="lotto-row' in calculator
Loading