ignore
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGlobal Ignore Patterns
全局忽略规则
Manage global ignore patterns for the linter.
lint-relative-paths管理 linter的全局忽略规则。
lint-relative-pathsPurpose
用途
Some repositories intentionally use relative paths in markdown (e.g., )
instead of repo-root paths (e.g., ). This command manages a global ignore
file that skips path validation for matching workspaces.
../docs/file.md/docs/file.md有些代码仓库会有意在markdown中使用相对路径(例如 )而非仓库根路径(例如 )。本命令用于管理全局忽略文件,对匹配的工作区跳过路径校验。
../docs/file.md/docs/file.mdActions
操作
| Action | Description | Example |
|---|---|---|
| Add a pattern to the global ignore file | |
| Show current patterns | |
| Remove a pattern from the ignore file | |
| 操作 | 描述 | 示例 |
|---|---|---|
| 向全局忽略文件添加一条规则 | |
| 展示当前所有规则 | |
| 从忽略文件中删除一条规则 | |
Pattern Matching
规则匹配
Patterns use substring matching. A pattern matches if the workspace path contains the pattern.
Example: Pattern matches:
alpha-forge/Users/user/projects/alpha-forge/Users/user/eon/alpha-forge.worktree-feature-x/home/user/code/alpha-forge-v2
规则采用子串匹配机制。如果工作区路径包含该规则字符串,就会匹配成功。
示例:规则 会匹配以下路径:
alpha-forge/Users/user/projects/alpha-forge/Users/user/eon/alpha-forge.worktree-feature-x/home/user/code/alpha-forge-v2
Ignore File Location
忽略文件位置
~/.claude/lint-relative-paths-ignoreLines starting with are comments.
#~/.claude/lint-relative-paths-ignore以开头的行是注释。
#Execution
执行逻辑
Skip Logic
跳过逻辑
- If action + pattern provided -> execute directly
- If only provided -> show patterns immediately
list - If no arguments -> use AskUserQuestion flow
- 如果提供了操作+规则参数 -> 直接执行
- 如果仅提供了参数 -> 立即展示现有规则
list - 如果没有参数 -> 进入AskUserQuestion流程
Workflow
工作流程
- Check Current State: Run to show existing patterns
list - Action Selection: Use AskUserQuestion to select action:
- "Add a new pattern" -> prompt for pattern
- "Remove an existing pattern" -> show current patterns to select
- "Just view current patterns" -> display and exit
- Pattern Input: For add/remove, AskUserQuestion with examples
- Execute: Run the management script
- Verify: Confirm changes applied
- 检查当前状态:运行展示已有规则
list - 选择操作:使用AskUserQuestion选择要执行的操作:
- "添加新规则" -> 提示输入规则
- "删除现有规则" -> 展示当前规则供选择
- "仅查看当前规则" -> 展示后退出
- 规则输入:针对添加/删除操作,通过AskUserQuestion给出示例引导输入
- 执行:运行管理脚本
- 验证:确认变更已生效
AskUserQuestion Flow (No Arguments)
交互式询问流程(无参数时)
When invoked without arguments, guide the user interactively:
Question: "What would you like to do with lint-relative-paths ignore patterns?"
Options:
- "Add pattern" -> "Add a new repository pattern to skip path linting"
- "List patterns" -> "Show all current ignore patterns"
- "Remove pattern" -> "Remove an existing pattern from the ignore list"For "Add pattern":
Question: "Enter the repository pattern to ignore"
Note: Patterns use substring matching. Example: 'alpha-forge' matches any path containing 'alpha-forge'.当调用时没有传入参数,会以交互方式引导用户操作:
Question: "What would you like to do with lint-relative-paths ignore patterns?"
Options:
- "Add pattern" -> "Add a new repository pattern to skip path linting"
- "List patterns" -> "Show all current ignore patterns"
- "Remove pattern" -> "Remove an existing pattern from the ignore list"选择“添加规则”时:
Question: "Enter the repository pattern to ignore"
Note: Patterns use substring matching. Example: 'alpha-forge' matches any path containing 'alpha-forge'.Direct Execution (With Arguments)
直接执行(带参数时)
Parse and run the management script:
$ARGUMENTSbash
/usr/bin/env bash << 'IGNORE_SCRIPT_EOF'
PLUGIN_DIR="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/marketplaces/cc-skills/plugins/statusline-tools}"
bash "$PLUGIN_DIR/scripts/manage-ignore.sh" $ARGUMENTS
IGNORE_SCRIPT_EOF解析并运行管理脚本:
$ARGUMENTSbash
/usr/bin/env bash << 'IGNORE_SCRIPT_EOF'
PLUGIN_DIR="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/marketplaces/cc-skills/plugins/statusline-tools}"
bash "$PLUGIN_DIR/scripts/manage-ignore.sh" $ARGUMENTS
IGNORE_SCRIPT_EOFManual Editing
手动编辑
The ignore file can also be edited manually:
bash
undefined忽略文件也可以手动编辑:
bash
undefinedView current patterns
View current patterns
cat ~/.claude/lint-relative-paths-ignore
cat ~/.claude/lint-relative-paths-ignore
Add a pattern manually
Add a pattern manually
echo "my-repo-pattern" >> ~/.claude/lint-relative-paths-ignore
undefinedecho "my-repo-pattern" >> ~/.claude/lint-relative-paths-ignore
undefinedTroubleshooting
故障排查
| Issue | Cause | Solution |
|---|---|---|
| Pattern not matching | Substring match is strict | Use broader pattern (e.g., |
| Ignore file not found | ~/.claude doesn't exist | Create with |
| Permission denied | File not writable | Check file permissions with |
| Script not found | Plugin not installed | Reinstall plugin from marketplace |
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 规则未匹配 | 子串匹配是严格匹配 | 使用范围更广的规则(例如 |
| 未找到忽略文件 | ~/.claude目录不存在 | 执行 |
| 权限被拒绝 | 文件不可写 | 用 |
| 未找到脚本 | 插件未安装 | 从应用市场重新安装插件 |