Skip to content

fix: 补齐合并后校验边界 - #15

Merged
zhinkgit merged 1 commit into
zhinkgit:mainfrom
shipiyouniao:fix/review-findings-after-maintenance
Sep 3, 2026
Merged

zhinkgit merged 1 commit into
zhinkgit:mainfrom
shipiyouniao:fix/review-findings-after-maintenance

Conversation

@shipiyouniao

Copy link
Copy Markdown
Contributor

背景

补齐 #12 合并后审查发现的四个边界问题,并适配 #14 合并后的维护脚本目录结构。

修改内容

  • 将 DEL (0x7f) 纳入控制字符校验,覆盖 SSH 配置字段、probe alias 和 known-hosts 路径。
  • 仓库检查与测试发现只按仓库根目录以内的相对路径过滤 dist、.venv 等目录,避免检出路径的上级目录同名时静默跳过全部检查。
  • 增加对应回归测试。
  • 补齐 chore(repo): 收拢仓库维护脚本与测试 #14 移动测试后所需的 E402 定向标注。

验证

  • Windows Python 3.10 / 3.13:仓库检查与 compileall 通过;每个版本执行 46 项测试,44 项通过,2 项符号链接用例因本机权限跳过。
  • Linux Python 3.10 / 3.13:仓库检查与 compileall 通过;每个版本 46/46 项测试通过,符号链接安全用例实际执行。
  • Ruff、Actionlint、Zizmor 通过。
  • 完整包及 12 个独立 skill 包构建成功,13 个 SHA-256 校验全部通过。

Copilot AI lite review requested due to automatic review settings September 3, 2026 05:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are small, targeted, and include direct regression tests covering the new boundary conditions and the repository-root filtering fix.

Pull request overview

This PR addresses several post-merge validation and repository-tooling edge cases: it expands control-character validation to include DEL (0x7f) across SSH-related inputs, and fixes maintenance tooling so skip-directory filtering applies only within the repository root (avoiding silent “skip everything” when an ancestor directory happens to be named dist, .venv, etc.). It also adds regression tests and updates lint annotations after the maintenance test relocation.

Changes:

  • Expand control-character validation to treat 0x7f as invalid for SSH alias, SSH config single-line metadata fields, and known-hosts path inputs.
  • Fix repository scanning and test discovery to apply skip-directory filtering based on path.relative_to(root) (not full filesystem path parts).
  • Add/adjust regression tests and add targeted noqa: E402 where imports intentionally follow sys.path modification.
File summaries
File Description
ssh/tests/test_ssh_probe.py Adds regression coverage for DEL (0x7f) in alias and known-hosts path validation.
ssh/tests/test_ssh_config.py Extends single-line metadata validation tests to include DEL (0x7f) cases.
ssh/scripts/ssh_probe.py Centralizes control-character detection and applies it to alias and known-hosts path validation.
ssh/scripts/ssh_config.py Updates single-line field validation to reject DEL (0x7f) via a helper.
.github/maintenance/tests/test_repo_tools.py Adds regression tests ensuring skip-directory filtering ignores ancestor directory names; adds E402 suppressions.
.github/maintenance/run_tests.py Extracts find_test_directories() and fixes skip-directory filtering to be relative to the repository root.
.github/maintenance/repo_checks.py Fixes matching_files() skip-directory filtering to be relative to the repository root.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@zhinkgit
zhinkgit merged commit 536c1f9 into zhinkgit:main Sep 3, 2026
5 checks passed
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.

3 participants