Repository navigation
fix: 补齐合并后校验边界 - #15
Conversation
There was a problem hiding this comment.
🟢 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
0x7fas invalid for SSH alias, SSH config single-line metadata fields, andknown-hostspath 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: E402where imports intentionally followsys.pathmodification.
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.
背景
补齐 #12 合并后审查发现的四个边界问题,并适配 #14 合并后的维护脚本目录结构。
修改内容
DEL (0x7f)纳入控制字符校验,覆盖 SSH 配置字段、probe alias 和 known-hosts 路径。dist、.venv等目录,避免检出路径的上级目录同名时静默跳过全部检查。E402定向标注。验证