Put my logo everywhere

Todo: 7808ee0a
This commit is contained in:
Krzysztof Rudnicki 2026-11-21 10:45:59 +01:00
parent 01a6b7e5e7
commit 2e0111724b
14 changed files with 105 additions and 8 deletions

View File

@ -96,6 +96,8 @@ repos:
rev: v3.3.2
hooks:
- id: pylint
# dill (pylint --jobs) crashes on 3.15 (co_lnotab gone); 3.14 until it catches up.
language_version: python3.14
args:
- --rcfile=pyproject.toml
- --fail-under=10
@ -108,6 +110,7 @@ repos:
# than merely an old one.
- gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.12.0#subdirectory=gatelock
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.11.1#subdirectory=crdt-sync
- kuhy-credit @ git+https://github.com/kuhyx/utils@kuhy-credit-v0.3.1#subdirectory=kuhy_credit
- freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.3#subdirectory=freedays
- sickdays @ git+https://github.com/kuhyx/utils@sickdays-v0.5.4#subdirectory=sickdays
# Test suites intentionally use patterns (protected-access, magic-value

View File

@ -2,6 +2,7 @@ import 'dart:developer' as developer;
import 'package:crdt_sync_flutter/crdt_sync_flutter.dart'
show E2ePassphraseButton;
import 'package:kuhy_credit/kuhy_credit.dart';
import 'package:material_ui/material_ui.dart';
import 'package:sync_settings_ui/sync_settings_ui.dart';
@ -192,6 +193,8 @@ class SettingsScreen extends StatelessWidget {
appRoute<void>(context, (_) => const GitHubMirrorScreen()),
),
),
const SizedBox(height: 24),
const Center(child: KuhyCredit()),
],
),
);

View File

@ -474,6 +474,15 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.12.0"
kuhy_credit:
dependency: "direct main"
description:
path: "kuhy_credit/flutter"
ref: "kuhy-credit-v0.3.1"
resolved-ref: "2352c177232a4b4594573a3b1126697ef32851f7"
url: "https://github.com/kuhyx/utils"
source: git
version: "0.3.1"
leak_tracker:
dependency: transitive
description:

View File

@ -45,6 +45,11 @@ dependencies:
ref: google_account_token-v0.1.0
path: google_account_token
http: 1.6.0
kuhy_credit:
git:
url: https://github.com/kuhyx/utils
ref: kuhy-credit-v0.3.1
path: kuhy_credit/flutter
material_ui: 1.11.1
path: 1.9.1
path_provider: 2.1.6

View File

@ -1,7 +1,9 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:kuhy_credit/kuhy_credit.dart';
import 'package:material_ui/material_ui.dart';
import 'package:wake_alarm_sync/screens/github_mirror_screen.dart';
import 'package:wake_alarm_sync/screens/settings_screen.dart';
import 'package:wake_alarm_sync/screens/settings_screen.dart'
show SettingsScreen;
import 'package:wake_alarm_sync/ui/theme.dart';
void main() {
@ -104,4 +106,14 @@ void main() {
expect(find.byIcon(Icons.error_outline), findsOneWidget);
expect(find.byIcon(Icons.check_circle), findsNothing);
});
testWidgets('shows exactly one KuhyCredit at the bottom', (tester) async {
await tester.pumpWidget(
MaterialApp(theme: buildAppTheme(), home: const SettingsScreen()),
);
final creditFinder = find.byType(KuhyCredit);
await tester.scrollUntilVisible(creditFinder, 500);
expect(creditFinder, findsOneWidget);
});
}

View File

@ -17,6 +17,7 @@ dependencies = [
# Sick days stand the PC's enforcement down (_sick.py). Imported behind
# a guard: missing means "not sick", never a crashed tick.
"sickdays @ git+https://github.com/kuhyx/utils@sickdays-v0.5.6#subdirectory=sickdays",
"kuhy-credit @ git+https://github.com/kuhyx/utils@kuhy-credit-v0.3.1#subdirectory=kuhy_credit",
]
# Package discovery must be explicit: phone_app/ is a Flutter app, not a Python

View File

@ -4,10 +4,11 @@
# it is missing — but it is required here for mypy/pylint/tests.
bandit==1.9.4
codespell==2.4.3
coverage==7.17.3
coverage==7.17.4
crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.11.1#subdirectory=crdt-sync
freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.3#subdirectory=freedays
gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.16.0#subdirectory=gatelock
kuhy-credit @ git+https://github.com/kuhyx/utils@kuhy-credit-v0.3.1#subdirectory=kuhy_credit
mypy==2.4.1
pre-commit==4.7.0
pylint==4.1.4

View File

@ -22,6 +22,7 @@ import sys
from typing import TYPE_CHECKING
import freedays
from kuhy_credit import credit_line
from wake_alarm._audit_checks import alarm_from_events, flags, run_checks
from wake_alarm._audit_evidence import Check, Evidence, PcSide, PhoneSide
@ -169,7 +170,10 @@ def write_report(day: date, text: str) -> str:
def main(argv: list[str] | None = None) -> int:
"""Entry point; exit 1 if unwritable, 2 if a report exists and no flag."""
parser = argparse.ArgumentParser(description="Audit one wake-up")
parser = argparse.ArgumentParser(
description="Audit one wake-up",
epilog=credit_line(),
)
parser.add_argument("day", nargs="?", type=date.fromisoformat, default=None)
parser.add_argument(
"--stdout",

View File

@ -13,13 +13,18 @@ from datetime import datetime
import sys
from typing import TYPE_CHECKING
from kuhy_credit import credit_line
if TYPE_CHECKING:
from collections.abc import Callable
def mode_parser(description: str, act: str, act_help: str) -> argparse.ArgumentParser:
"""A parser with exactly one of ``--<act>``, ``--dry-run``, ``--show``."""
parser = argparse.ArgumentParser(description=description)
parser = argparse.ArgumentParser(
description=description,
epilog=credit_line(),
)
mode = parser.add_mutually_exclusive_group(required=True)
mode.add_argument(f"--{act}", action="store_true", help=act_help)
mode.add_argument("--dry-run", action="store_true", help="decide, change nothing")

View File

@ -24,6 +24,8 @@ import struct
import sys
import wave
from kuhy_credit import credit_line
SAMPLE_RATE = 16_000
RISE_SECONDS = 60.0
LOOP_SECONDS = 20.0
@ -108,7 +110,10 @@ def ensure_pair(preferred: Path, fallback: Path) -> tuple[Path, Path]:
def main(argv: list[str] | None = None) -> int:
"""Write the pair into ``--write DIR``."""
parser = argparse.ArgumentParser(description="Generate the fallback ring WAVs")
parser = argparse.ArgumentParser(
description="Generate the fallback ring WAVs",
epilog=credit_line(),
)
parser.add_argument("--write", type=Path, required=True, metavar="DIR")
args = parser.parse_args(sys.argv[1:] if argv is None else argv)
for path in write_pair(args.write):

View File

@ -35,6 +35,7 @@ import time
from typing import TYPE_CHECKING
from gatelock.log_integrity import compute_entry_hmac, verify_entry_hmac
from kuhy_credit import credit_line
from wake_alarm._constants import (
FALLBACK_ALARM_HOUR,
@ -173,7 +174,8 @@ def describe(entry: dict[str, object], now: datetime) -> str:
def _parse_args(argv: list[str]) -> argparse.Namespace:
parser = argparse.ArgumentParser(
description="PC copy of the phone's morning session"
description="PC copy of the phone's morning session",
epilog=credit_line(),
)
mode = parser.add_mutually_exclusive_group(required=True)
mode.add_argument(

View File

@ -29,6 +29,8 @@ import logging
import sys
import time
from kuhy_credit import credit_line
from wake_alarm._alarm_payload import in_range
from wake_alarm._constants import (
ALARM_CACHE_FILE,
@ -212,7 +214,8 @@ def get_alarm(*, max_cache_age_seconds: float = ALARM_CACHE_MAX_AGE_SECONDS) ->
def _parse_args(argv: list[str]) -> argparse.Namespace:
"""Parse CLI arguments for the sync reader."""
parser = argparse.ArgumentParser(
description="Show the alarm time the phone last synced."
description="Show the alarm time the phone last synced.",
epilog=credit_line(),
)
parser.add_argument(
"--show",

View File

@ -27,6 +27,7 @@ import subprocess
import sys
import freedays
from kuhy_credit import credit_line
from wake_alarm._constants import (
ALARM_DAYS,
@ -164,7 +165,8 @@ def _decide(now: datetime, alarm: Alarm) -> tuple[bool, str]:
def _parse_args(argv: list[str]) -> argparse.Namespace:
"""Parse CLI arguments for the trigger."""
parser = argparse.ArgumentParser(
description="Fire the morning routine at the phone's alarm time."
description="Fire the morning routine at the phone's alarm time.",
epilog=credit_line(),
)
parser.add_argument(
"--dry-run",

View File

@ -0,0 +1,42 @@
"""Tests that every CLI parser's --help output ends with credit_line()."""
import subprocess
import sys
import pytest
from kuhy_credit import credit_line
MODULES_WITH_CLI = [
"wake_alarm._audit",
"wake_alarm._ring_wav",
"wake_alarm._session",
"wake_alarm._trigger",
"wake_alarm._sync",
]
def _run_help(module: str) -> str:
"""Run `python -m <module> --help` and return stdout."""
result = subprocess.run(
[sys.executable, "-m", module, "--help"],
capture_output=True,
text=True,
)
if result.returncode != 0:
# Some modules need a subcommand; mode_parser is one. Try without --help.
result = subprocess.run(
[sys.executable, "-m", module],
capture_output=True,
text=True,
)
return result.stdout
@pytest.mark.parametrize("module", MODULES_WITH_CLI)
def test_help_ends_with_credit_line(module: str):
"""The --help output must end with credit_line()."""
help_text = _run_help(module)
assert help_text.endswith(credit_line() + "\n"), (
f"Module {module} help does not end with credit_line()"
)