docs: audit and prune low-value comments across src/#77
Merged
Conversation
- Remove stale ContentType::Image "stored as base64" doc that no longer
matches the on-disk-sidecar storage path.
- Promote a dangling `///` between use statements in gui/board/preview.rs
into a proper module `//!` doc.
- Drop historical 'merged from gui/hotkey_record.rs' marker.
- Drop signature-restating doc comments across repository, updater, i18n,
gui/board, gui/panel, gui/{tray,theme}, clipboard/writer, config and
constants modules so symbol names speak for themselves.
- Compress SAFETY blocks in gui/utils.rs and utils/single_instance.rs to
the actual local invariants (with a shared module-level note in
gui/utils.rs covering the common preconditions).
- Drop `# Arguments`/`# Returns` boilerplate on self-explanatory APIs in
config/autostart.rs and `# Usage Example` blocks in
gui/board/preview.rs.
- Tighten the macOS race-condition note in clipboard/writer.rs and the
inline subsystem-init markers in app.rs.
Behavior is unchanged; precheck.sh passes locally (cargo check, clippy,
421 tests, machete, i18n/icons/themes).
Refs #76
a71188d to
a2c1dbd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Repository-wide comment audit driven by Clean Code's "explain why, not what" principle. Drops stale, dangling, and signature-restating comments; compresses verbose
SAFETY:blocks; preserves every module-level//!doc and why comment that pulls its weight.Linked Issue
Closes #76
Changes
repository/models.rs: drop theImage (stored as base64)doc that contradicts the current sidecar storage path; tightenContentTypeandClipboardRecordfield docs to the few that actually add context.gui/board/preview.rs: promote a///floating between twousestatements into a real module//!doc.gui/board/hotkey_record_handler.rs: remove themerged from gui/hotkey_record.rshistorical marker (git history covers it).repository/{errors, backend, repo, favorites, cleanup}.rs,updater/{models, http}.rs,i18n/{error, translations}.rs,gui/board/{record_ops, settings_editor, clear_confirm, header, filtering, updater_ui}.rs,gui/panel/{about, help, settings}.rs,gui/{tray, theme}.rs,clipboard/writer.rs,config/settings/mod.rs, andconstants.rs. Where the why matters (dedup behavior, sidecar lifetime, validation contract, cleanup-buffer rationale, etc.) the doc is rewritten to state it.gui/utils.rs: introduce a module-level//!capturing the SAFETY invariants shared across all 11 Win32 blocks; per-block// SAFETY:notes now only call out block-specific deltas.utils/single_instance.rs: SAFETY block compressed; add a why note explaining theZed::Windowmagic class name (GPUI's Win32 class).config/autostart.rs: drop# Arguments/# Returnsrustdoc templates; rewriteget_app_pathandsync_statedocs to explain the.app-bundle constraint and the no-op-when-equal rationale.gui/board/preview.rs: drop# Usage Exampleblocks.clipboard/writer.rs: tighten the macOS race-condition note.constants.rs: replace the historical narrative with a one-line module doc; expandSILENT_ARGto explain why it exists.app.rs'slaunch()collapsed; the genuinely helpful ordering / dependency notes (Settings before I18n, tray needs I18n) survive in concise form.Behavior is unchanged — comments only.
Testing
scripts/precheck.shpasses locally (cargo check,cargo clippy -D warnings, 421 tests passed,cargo machete,check_i18n.py,check_icons.py,check_themes.py)