Commit Graph

96 Commits

Author SHA1 Message Date
2545d72710 test: achieve 100% branch coverage across all python_pkg packages
- Add comprehensive tests for all packages (3572 tests, 100% branch coverage)
- Split oversized test files to stay under 500-line limit
- Add per-file ruff ignores for test-appropriate suppressions
- Fix _cache_decks.py to properly convert JSON lists to tuples
- Add session-scoped conftest fixture for logging handler cleanup (Python 3.14)
- Update ruff pre-commit hook to v0.15.2
- Add codespell ignore words for test data
- Add generated output files to .gitignore
2026-03-21 17:51:36 +01:00
72c6c3788c refactor: move Python packages under python_pkg/
- Move puzzle_solver/, poker_modifier_app/, articles/, tests/ into python_pkg/
- Move moviepy_showcase.py and _moviepy_*.py into python_pkg/moviepy_showcase/
- Update all imports to use python_pkg. prefix
- Update pyproject.toml per-file-ignores and pytest testpaths
- Add pre-commit hook to enforce Python files under python_pkg/
2026-03-18 22:54:45 +01:00
21b7b8107b fix: resolve all pre-commit hook failures after file splits
- Remove all # type: ignore and # noqa comments (banned by no-noqa hook)
- Add mypy --disable-error-code flags to pre-commit config for error
  codes previously suppressed by inline comments
- Fix broken imports after ruff auto-removed re-exports:
  steam_backlog_enforcer, stockfish_analysis, word_frequency, lichess_bot
- Re-add re-exports with __all__ in translator.py, screen_lock.py
- Split _process_epc_fc.py (524 lines) into _process_epc_fc.py + _process_fc.py
- Fix test failures: keyboard_coop, stockfish_analysis, tag_divider
- Add per-file-ignores for PLC0415 (deferred imports) in 7 files
- Mark shebang scripts as executable
- Add __init__.py for generate_images and repo_explorer packages
- Fix codespell, eslint, ruff-format, prettier issues
- Update copilot-instructions.md with --no-verify ban
2026-03-18 22:20:05 +01:00
50fd6812d7 refactor: enforce 500-line limit on all Python source files
Split 18+ Python files that exceeded 500 lines into smaller modules
with helper files (prefixed with _). All functions are re-exported
from the original modules to maintain backward compatibility with
test patches and external imports.

Files split:
- moviepy_showcase.py (1212 -> 302 + 3 helpers)
- anki_generator.py (1174 -> 473 + 4 helpers)
- test_analyze_chess_game.py (1152 -> 361 + 2 parts)
- poker_modifier_app.py (1024 -> 263 + 2 helpers)
- transcribe_fw.py (1007 -> 342 + 3 helpers)
- music_generator.py (1002 -> 319 + 2 helpers)
- translator.py (951 -> 442 + 2 helpers)
- cinema_planner.py (893 -> 369 + 2 helpers)
- lichess_bot/main.py (757 -> 495 + _game_logic.py)
- test_translator.py (725 -> 289 + part2 + conftest)
- test_lichess_api.py (680 -> 475 + part2)
- learning_pipe.py (668 -> 375 + 2 helpers)
- cache.py (655 -> 360 + _cache_decks.py)
- analyze_chess_game.py (632 -> 463 + _move_analysis.py)
- visualize_q02.py (609 -> 371 + helper)
- repo_explorer.py (602 -> 347 + 2 helpers)
- keyboard_coop/main.py (515 -> 416 + _dictionary.py)
- scanning.py (501 -> 314 + _enforce_loop.py)

All tests pass: 144 lichess_bot (100% branch coverage), 243 others.
No new lint errors introduced.
2026-03-17 22:47:42 +01:00
c4225496d3 fix(steam_backlog_enforcer): reload state in enforce loop, use steam:// protocol for installs
The enforce daemon loaded state once at startup and never reloaded it.
When the CLI reassigned a game (e.g. via 'done'), the daemon kept
enforcing the old assignment and deleted the newly assigned game every
3 seconds as 'unauthorized'.

Fix: reload state from disk at the top of each enforce loop iteration
so CLI changes take effect within one cycle.

Also add steam://install protocol handler for interactive installs
(via xdg-open) so Steam determines the correct installdir from its
own metadata, avoiding 'Missing game executable' errors from guessed
directory names in fabricated appmanifests.
2026-03-17 21:48:33 +01:00
c985160d17 WIP: Enforce 500-line limit - split batch 1
Split 16+ files. 27 files still need splitting. See session notes.
2026-03-16 22:46:48 +01:00
e51c12dd8e feat: puzzle solver algorithm 2026-03-16 19:49:52 +01:00
e7d2ecabb1 fix: resolve remaining ruff violations (FURB110, PLC0207)
- generate_blunder_tests.py: use 'or' instead of ternary (FURB110)
- music_generator.py: use 'or' instead of ternary (FURB110), fix type: ignore
- random_digits.py: use rsplit with maxsplit instead of split (PLC0207)
2026-03-14 17:51:55 +01:00
a77fd7f0fd refactor(praca/generate_images): fix ruff violations in generate_q23_diagrams.py 2026-03-14 17:47:32 +01:00
fe3cba03cd refactor(praca/generate_images): fix ruff violations in generate_process_diagrams.py 2026-03-14 17:28:21 +01:00
21d501bed4 refactor(praca/generate_images): fix ruff violations in generate_q24_diagrams.py 2026-03-14 17:15:35 +01:00
183f9bbc19 refactor(praca/generate_images): fix ruff violations in generate_arch_diagrams.py 2026-03-14 17:07:01 +01:00
21781d547e refactor(praca/generate_images): fix ruff violations in generate_q9_q12_diagrams.py 2026-03-14 16:38:10 +01:00
33f5c957df refactor(praca/generate_images): fix ruff violations in generate_q9_all_diagrams.py 2026-03-14 16:28:34 +01:00
9b4e9722f0 refactor(praca/generate_images): fix ruff violations in generate_study_diagrams.py 2026-03-14 16:19:59 +01:00
1721275423 refactor(praca/generate_images): fix ruff violations in generate_q20_diagrams.py 2026-03-14 16:04:14 +01:00
9041e87d32 refactor(praca/generate_images): fix ruff violations in generate_scheduling_diagrams.py 2026-03-14 15:51:02 +01:00
7c47befe04 refactor(praca/generate_images): fix ruff violations in diagram generators batch 1 2026-03-14 14:29:54 +01:00
03409b6839 refactor(praca): fix ruff violations in visualize scripts 2026-03-14 14:29:18 +01:00
d488c87203 refactor(praca_magisterska_video): fix ruff violations and remove noqa from diagram generators
- Add type annotations, docstrings, and constants
- Remove commented-out code and print statements
- Fix all lint issues in 11 generate_images files
2026-03-13 20:52:27 +01:00
1e108d1e3f refactor(tests): remove noqa comments from test files
- Fix lint issues in keyboard_coop, lichess_bot, and tag_divider tests
- Prefix unused parameters with underscore instead of noqa: ARG002
2026-03-13 20:49:25 +01:00
0d47f77ee5 refactor: remove noqa comments from miscellaneous scripts
- Fix underlying lint issues instead of suppressing with noqa
- Files: moviepy_showcase, pomodoro-wake-daemon, brother_printer,
  http_status_anki, geo_data, repo_explorer, steam_backlog_enforcer,
  music_generator
2026-03-13 20:48:40 +01:00
078a4c0071 refactor(anki_decks): remove all noqa comments and fix underlying issues
- Replace module-level globals with _mp_state dict (PLW0603)
- Use hashlib.sha256 instead of md5 (S324)
- Use secrets.randbelow instead of random.randrange (S311)
- Use tempfile.gettempdir() instead of hardcoded /tmp (S108)
- Replace assert statements with RuntimeError (S101)
2026-03-13 20:47:52 +01:00
8623276339 refactor(screen_locker): remove all noqa comments from tests
- Prefix unused mock parameters with underscore instead of noqa: ARG002
- Remove 102 noqa suppression comments
2026-03-13 20:46:45 +01:00
0460f3fac6 refactor(word_frequency): fix all ruff violations and remove noqa comments
- Replace print() with logging module throughout
- Add type annotations and Google docstrings to all functions
- Introduce DeckInput and LessonConfig dataclasses to reduce function parameters
- Use specific exception types instead of bare except (BLE001)
- Remove all noqa suppression comments
- Fix test fixtures: remove unused _capsys/_tmp_path parameters
2026-03-13 20:41:31 +01:00
5cd30db5a2 refactor(cinema_planner): fix all ruff violations, add type hints, docstrings, logging
- Replace print() with logging module
- Add type annotations to all functions
- Add Google-style docstrings to all public functions/classes
- Extract magic numbers into named constants
- Break complex functions into smaller helpers
- Use Path.open() instead of open()
- Use contextlib.suppress where appropriate
2026-03-13 20:35:21 +01:00
ee68d47a4c feat: improvements in hosts bluetooth focus mode and backglog scripts 2026-03-11 20:47:03 +01:00
7fa2019124 Merge branch 'main' of https://github.com/kuhyx/testsAndMisc 2026-03-09 18:36:54 +01:00
de98faafc9 feat: robotgo improvements in phone focus bluetooth and printer scripts 2026-03-09 18:34:15 +01:00
43f5ef321d feat: better screen lock checker 2026-03-08 21:39:39 +01:00
f4b77e51dc feat: improvements in steam backlog and brother printer 2026-03-04 22:40:49 +01:00
e76c2c68ee feat: steam 100 percent extension 2026-03-02 20:29:32 +01:00
3f5d57871f refactor: auto-detect wireless ADB device, remove phone_config.txt
- Replace stored phone_config.txt with _get_wireless_serial() which
  parses 'adb devices' and auto-picks the ip:port (wireless) entry
- Replace _scan_phone_port-based reconnect with _try_wireless_reconnect
  that scans local /24 subnet on port 5555 via parallel probing
- Add _get_local_subnet_prefix() using UDP socket trick (8.8.8.8:80)
- Remove PHONE_CONFIG_FILE, _load_phone_config, _save_phone_config,
  _save_connected_device_config, _scan_phone_port
- No config file needed; device is always discovered dynamically
- 112 tests passing
2026-02-24 21:19:47 +01:00
64a382e82c feat: screen locker phone check at startup with background thread
- ADB check runs in background thread (ThreadPoolExecutor) so the UI
  remains responsive while checking StrongLifts on the phone
- Poll result every 500ms via root.after instead of blocking main thread
- Show success screen for 1.5s before auto-unlocking when verified
- Target specific ADB device via -s flag using saved phone_config.txt
  to avoid errors when multiple devices (USB + wireless) are connected
- Demo mode uses local grab_set() instead of grab_set_global() so it
  works alongside other fullscreen apps
- Stub _start_phone_check in create_locker to prevent background threads
  leaking into unrelated tests (fixes flaky test_run_adb_success)
- 112 tests passing, 100% branch coverage
2026-02-24 21:11:05 +01:00
192c91094e feat: screen locker made even stronger 2026-02-23 22:50:42 +01:00
cc8cc53dfb feat: added run sh and makefile scripts 2026-02-22 22:00:50 +01:00
f4f25821e5 feat: shell scripts 2026-02-22 16:57:36 +01:00
265488a478 feat: added scripts for generating images for praca magisterska obrona 2026-02-22 13:08:14 +01:00
8fb2e96363 feat: moviepy showcase full 2026-02-21 20:40:33 +01:00
feac2a7aa8 fix: install sh i3 2026-02-20 20:43:37 +01:00
9e4fee54d7 pre commit fixes 2026-02-20 00:21:41 +01:00
20337f07eb fixes for existing scripts and pomodoro with local sync 2026-02-14 18:42:20 +01:00
93426490c4 Consolidate all Anki deck generators into python_pkg/anki_decks/
Move warsaw_bridges, warsaw_districts, warsaw_landmarks, warsaw_metro,
warsaw_osiedla, warsaw_streets, and car_brand_logos into the existing
python_pkg/anki_decks/ directory alongside the polish_* generators.

Also move preview_all.html into anki_decks/.

Update all import paths, filesystem references in geo_data.py,
docstrings, READMEs, test imports, and .gitignore accordingly.
2026-02-07 15:32:23 +01:00
11427631cd feat: added flake8 max funciton length 2026-02-06 21:39:15 +01:00
029a99aaba feat: added flake8 2026-02-06 21:25:57 +01:00
f28bb77df1 feat: brother printer checker 2026-02-06 21:21:52 +01:00
f557c22e7c feat(screen_locker): harden table tennis verification, remove running option
- Remove 'Running' workout option (too easy to fake)
- Add MIN_TABLE_TENNIS_SETS=15 minimum requirement
- Add MIN_POINTS_PER_SET=11 mathematical cross-check
- Add TABLE_TENNIS_SUBMIT_DELAY=60 (increased from 30)
- Add verification question before unlock (total points/avg/diff)
- Require minimum duration per set (2 min/set)
2026-02-02 21:38:52 +01:00
a58568faa6 feat: some improvemnets to http cat anki 2026-01-18 14:35:41 +01:00
Copilot
7a211649b9 Add Polish license plate Anki flashcard generator with Wikipedia data extraction and caching (#4)
* Initial plan

* Add Polish license plate Anki generator with bidirectional cards

Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>

* Add comprehensive README for Polish license plates package

Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>

* Fix license plate data: correct WT (Wawer) and WWY (Wyszków) mappings

Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>

* Add Wikipedia scraper for automatic license plate data extraction

Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>

* Improve fetch_license_plates: add constants and update User-Agent

Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>

* Add caching to Wikipedia scraper to avoid unnecessary requests

Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>

* Add error handling for cache file operations

Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>
2026-01-18 14:30:22 +01:00
Copilot
652e86c370 Add HTTP status code Anki deck generator with http.cat images (#3)
* Initial plan

* Add HTTP status code Anki deck generator with cat images

Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>

* Address code review feedback: improve test parameter handling

Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>
2026-01-14 21:52:20 +01:00