context-staged

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Run the codecontext staged check across all files in the git staging area.
bash
npx codecontext --staged
If stale annotations are found:
  1. List each stale annotation with its file, line, and reason.
  2. For each, recommend either:
    • Bumping
      [verified:YYYY-MM-DD]
      to today if the context is still accurate.
    • Updating the annotation summary if the context changed.
    • Removing the annotation if the code it described was deleted.
  3. Do not proceed with the commit until all annotations are verified.
If all annotations are fresh, confirm that the staged files are clear to commit.
对Git暂存区中的所有文件执行codecontext的暂存检查。
bash
npx codecontext --staged
如果发现过期注释:
  1. 列出每个过期注释对应的文件、行号及原因。
  2. 针对每个过期注释,推荐以下处理方式之一:
    • 如果上下文信息仍然准确,将
      [verified:YYYY-MM-DD]
      更新为当前日期。
    • 如果上下文信息已变更,更新注释摘要。
    • 如果注释描述的代码已被删除,移除该注释。
  3. 在所有注释完成验证前,不允许继续提交。
如果所有注释均为最新状态,则确认暂存文件可以提交。