Skip to content

Trim comments that repeat the code - #255

Draft
BlivionIaG wants to merge 2 commits into
masterfrom
cursor/trim-repeating-comments-ec39
Draft

BlivionIaG wants to merge 2 commits into
masterfrom
cursor/trim-repeating-comments-ec39

Conversation

@BlivionIaG

@BlivionIaG BlivionIaG commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Purpose

Remove comments and docstrings from the owner's FetchCord 3.0 rewrite that only restate the next line. Comments that explain why stay. No behavior, dependency, or logic changes.

Deleted

  • fetch_cord/resources/fetchcord_cmds.yml — 17 step comments in the Windows, Linux, and Darwin memory scripts (total, available, convert, used, output, plus Darwin's page-size steps).
  • fetch_cord/__main__.py — 7 section labels: component ids, stop event, load config, load cycles, main loop, loop through cycles, and "reconnect if client_id changed".
  • fetch_cord/cycle.py — the close_connection docstring, and the two comments above close_connection() / raise in update.
  • fetch_cord/resources/systemd_service.py — one-line docstrings on get_systemd_user_dir, systemd_cmd, install, uninstall, enable, disable, start, stop, and status, plus the whole get_service_file_url docstring (the summary restates the function; the Args/Returns block restates the signature).
  • fetch_cord/tools.py — trunk-ignore comments for bandit B404, B602 on exec_bash, B603, and B607. A repo search finds trunk only on these suppressions, and Trunk is not invoked anywhere.
  • tests/test_fetch_cord.py — 25 class and method docstrings that only restate the test name (Test …, plus setUp's "Set up test fixtures"). Three blank lines that sat under the deleted TestConfig, TestCycle, and TestTools class docstrings also went, because ruff format rejects that empty line once the docstring is gone.
  • snapcraft.yaml — the stale sentence that the snap is unmaintained because core18 cannot ship Python 3.12. The file already sets base: core24.

Net diff against master: 78 deletions, 1 insertion (the shortened snap description line).

Kept on purpose

  • fetch_cord/__main__.py: the CLI-override note, the "Discord only allows one RP" note, and the mypy note about the signal handler. Later comments that explain a choice (pause, one snapshot per rotation, native fetchers) are untouched.
  • fetch_cord/cycle.py: the wait docstring, which explains why interval_duration is ignored.
  • fetch_cord/resources/systemd_service.py: validate_systemd_cmd's "prevent injection" docstring.
  • tests/test_fetch_cord.py: docstrings that give a reason, including test_cycle_wait_returns_promptly_when_stopped, the integration test that explains provider merge, TestFetchFunctions's "standalone, no module imports" note, the fastfetch parser and POSIX script class notes, and inline comments that explain an assertion.
  • snapcraft.yaml: "Prefer pip or Homebrew" and the reason this file still exists (existing snap listings).
  • fetch_cord/tools.py: the trunk-ignore(bandit/B602) above shell=shell in run_command.

Non-overlap with #253 and #254

Open PRs when this branch was cut: #253 and #254 only.

This branch does not touch any packaging file (#254: pyproject.toml, requirements.txt, MANIFEST.in, fetchcord.spec, Formula/fetchcord.rb, uv.lock).

It does not edit a line, or a line next to one, that #253 changes or deletes. Skipped because #253 already removes them:

Merged cleanly in both directions against cursor/delete-dead-fetchcord-api-f3ad (#253) and cursor/packaging-tooling-cleanup-86d5 (#254).

Proof

$ ruff check .
All checks passed!

$ ruff format --check .
44 files already formatted

$ mypy fetch_cord tests
Success: no issues found in 36 source files

$ python -m pytest tests/ -q --cov=fetch_cord --cov-fail-under=80
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-9.1.1, pluggy-1.6.0
rootdir: /workspace
configfile: pyproject.toml
plugins: cov-7.1.0, platformdirs-4.12.4
collected 203 items

tests/test_autostart.py .....................                            [ 10%]
tests/test_fetch_cord.py ...........................................s... [ 33%]
......                                                                   [ 36%]
tests/test_fixtures.py ......                                            [ 39%]
tests/test_more.py .................s.s................................. [ 65%]
..                                                                       [ 66%]
tests/test_native_windows.py ...............                             [ 73%]
tests/test_presence.py .......................                           [ 85%]
tests/test_processes.py .............                                    [ 91%]
tests/test_report.py ............                                        [ 97%]
tests/test_update_formula.py .....                                       [100%]

=============================== warnings summary ===============================
tests/test_fetch_cord.py: 1 warning
tests/test_more.py: 12 warnings
  /workspace/fetch_cord/tools.py:96: DeprecationWarning: path is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    with resources.path(package, resource) as path:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================ tests coverage ================================
_______________ coverage: platform linux, python 3.12.3-final-0 ________________

Name                                       Stmts   Miss  Cover
--------------------------------------------------------------
fetch_cord/__init__.py                         1      0   100%
fetch_cord/__main__.py                       151     22    85%
fetch_cord/args.py                            26      0   100%
fetch_cord/autostart.py                      143     32    78%
fetch_cord/config.py                          20      1    95%
fetch_cord/constants.py                       14      0   100%
fetch_cord/cycle.py                           78      4    95%
fetch_cord/fetch.py                          104      2    98%
fetch_cord/info.py                            60      4    93%
fetch_cord/native/Windows/__init__.py         13      8    38%
fetch_cord/native/Windows/cpu.py               4      0   100%
fetch_cord/native/Windows/host.py              3      0   100%
fetch_cord/native/Windows/kernel.py           12      2    83%
fetch_cord/native/Windows/mem.py              11      3    73%
fetch_cord/native/Windows/motherboard.py      12      0   100%
fetch_cord/native/Windows/os_info.py          12      0   100%
fetch_cord/native/Windows/packages.py         13     13     0%
fetch_cord/native/Windows/registry.py         24     11    54%
fetch_cord/native/__init__.py                  0      0   100%
fetch_cord/native/native.py                    9      1    89%
fetch_cord/presence.py                        66      0   100%
fetch_cord/processes.py                       48      0   100%
fetch_cord/report.py                          38      0   100%
fetch_cord/resources/__init__.py               0      0   100%
fetch_cord/resources/systemd_service.py       72      7    90%
fetch_cord/tools.py                           36      1    97%
fetch_cord/update.py                          43      7    84%
--------------------------------------------------------------
TOTAL                                       1013    118    88%
Required test coverage of 80% reached. Total coverage: 88.35%
================= 200 passed, 3 skipped, 13 warnings in 1.40s ==================

$ python -c "import yaml,sys; yaml.safe_load(open('fetch_cord/resources/fetchcord_cmds.yml'))"
(yaml parsed; no output)

pip install -e ".[dev]" was run first. The interpreter on this machine is python3; the commands above were run with that interpreter.

Assistance

This change was made with AI assistance.

Open in Web Open in Cursor 

cursoragent and others added 2 commits October 8, 2026 02:23
Drop narration from the 3.0 rewrite that restates the following
statement, and leave comments that explain why.

Co-authored-by: BlivionIaG <BlivionIaG@users.noreply.github.com>
Ruff format rejects the empty line that used to separate a class
docstring from the first method.

Co-authored-by: BlivionIaG <BlivionIaG@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants