testsAndMisc/linux_configuration/scripts/periodic_background/system-maintenance/bin
Krzysztof kuhy Rudnicki ad646541ad
Some checks are pending
Pre-commit checks / pre-commit (push) Waiting to run
Python tests / test (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run
usage_report: split _usage_report_render.py 310 -> 181 + 123 + 24
Verified by the 100%-coverage tests from the previous commit, written
before this seam existed.

_cpu_table/_dedupe_ram/_ram_table/_gpu_table move to
_usage_report_tables.py with the two constants they own. _md_escape and
_fmt_h move to _usage_report_format.py: both the tables module and the
render module need them, so a third module is what avoids a cycle.
Import sites name the owning module; no re-export barrel.

usage_report.py needed no edit - it imports _fmt_h and _render_report
from the render module, and both names still resolve there.

Evidence the move was verbatim: an AST comparison of all 10 functions
against HEAD reports 10 identical, 0 mismatches. That matters because I
retyped rather than cut-and-pasted, and did briefly introduce a literal
× where the original had × - ruff's RUF001 caught it.

Coverage stays 100% line+branch on all three (15/55/54 stmts, 4/10/14
branches, 0 missed). Test count 43 before and after, summed across the
five files it now lives in - the check that matters for a test split,
since a file outside the runner's glob is silently never collected.
Directory total 143 passed, unchanged.

Ran the real program: a full report from today's atop + pmon logs, every
section rendering through the new boundaries including the RAM sibling
dedupe and its (+20 more) truncation.

Over-cap 41 -> 39. No suppressions; a shared test-helper module was tried
and abandoned because name-tests-test would have needed an exclusion.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-17 11:34:08 +02:00
..
lib Split install_usage_monitoring.sh into an entry plus five libs 2026-08-17 07:26:56 +02:00
__init__.py Split modules, fix tests, fix pre-commit batching 2026-05-22 22:48:28 +02:00
_usage_report_format.py usage_report: split _usage_report_render.py 310 -> 181 + 123 + 24 2026-08-17 11:34:08 +02:00
_usage_report_parsing.py feat: split oversized modules for 500-line limit, fix kasa coverage gap 2026-06-14 07:19:37 +02:00
_usage_report_pmon.py feat: split oversized modules for 500-line limit, fix kasa coverage gap 2026-06-14 07:19:37 +02:00
_usage_report_render.py usage_report: split _usage_report_render.py 310 -> 181 + 123 + 24 2026-08-17 11:34:08 +02:00
_usage_report_tables.py usage_report: split _usage_report_render.py 310 -> 181 + 123 + 24 2026-08-17 11:34:08 +02:00
_usage_report_types.py fix(usage_report): stop charging atop's HZ field as CPU; bundle since-last-report mode 2026-06-04 18:13:47 +02:00
auto-system-update.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
browser-preexec-wrapper.sh Log why Chromium browsers die; whitelist librewolf 2026-08-09 22:27:16 +02:00
hosts-file-monitor.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
install_usage_monitoring.sh Split install_usage_monitoring.sh into an entry plus five libs 2026-08-17 07:26:56 +02:00
periodic-system-maintenance.sh fix(maintenance): make repair failures loud instead of silently exiting 0 2026-07-17 08:17:51 +02:00
shutdown-timer-monitor.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
usage_report.py feat: split oversized modules for 500-line limit, fix kasa coverage gap 2026-06-14 07:19:37 +02:00