From 0c00d576dd104cb83b10f492be2f0ec790c0183a Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 18 Aug 2026 12:31:59 +0800 Subject: [PATCH] improve comment rules --- AGENTS.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 7ab98087d..a32b940ad 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -63,10 +63,9 @@ ### Comments -* Keep them short: one line by default, three at most. -* Say **why**, never what. If the code already says it, delete the comment. -* A comment must never be longer than the code it describes. -* Applies to YAML, shell and Python too, not just Rust. +* Avoid comments unless they explain a non-obvious reason, constraint, or workaround. +* Never restate what the code does; prefer clearer code instead. +* If the code is self-explanatory, add no comment. ### Be minimally invasive