Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Filter terminal-unsafe characters through one helper: list and the status printer keep bidi overrides and zero-width characters that core policy::strip_unsafe drops

未关闭 适合新手
#1,860 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
83/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
cli, security

调研方向

阅读crates/socket-patch-core/src/policy/mod.rs以及crates/socket-patch-cli/src/commands/list.rs和crates/socket-patch-cli/src/ui/status.rs中的过滤器。按描述整合过滤逻辑,然后为包含 U+202E 和 U+200B 的描述添加单元测试;当这些字符被移除且普通列表输出仍逐字节完全一致时,即完成。

由索引模型根据 Issue 内容生成。

描述

agent:triaged arch-audit priority:p3 refactor

[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.

Kind: refactor. Register ID: T23.

Problem

Three functions filter characters before they reach the terminal:

So core already decided that bidi and zero-width characters are unsafe in output. list, however, prints API-sourced patch descriptions and vulnerability summaries through the weaker filter, so a description carrying U+202E can still reorder what the user sees. I found this by reading the code; I did not run it.

Proposed change
  1. Make core policy::strip_unsafe (or a renamed printable) keep \n and \t, and normalize \r\n, as list::sanitize does. Move it to a neutral home, such as utils::text or the CLI ui layer if core does not need it.
  2. Call it from list::sanitize's callers and from StatusPrinter::println, and delete the two copies.
Size

3 files, about −15 lines plus one test.

Acceptance criteria
  • list output for ordinary text is byte-identical.
  • A new unit test shows that a description containing \u{202E} and \u{200B} is printed without them.
  • policy tests are unchanged.
主要语言
Rust
星标
8
派生
2
平均合并
19 小时 12 分钟
30 天内合并 PR
709

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SocketDev/socket-patch 的其他 Issue

查看 SocketDev/socket-patch 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。