Commit 873a6ce
refactor: use ERE instead of BRE in grep patterns for clarity (#159)
## Description
Replace BRE (Basic Regular Expression) patterns with ERE (Extended
Regular Expression) in grep commands for improved readability.
## Type of Change
- [x] Refactoring (code change that neither fixes a bug nor adds a
feature)
## Component(s) Affected
- [x] Skills (methodology and best practices)
## Motivation and Context
BRE with escaped alternation (`grep -q "a\|b"`) is harder to read than
ERE (`grep -Eq "a|b"`). The escaped pipes are:
- Easy to forget or get wrong
- Less widely understood
- May behave differently across grep implementations
Fixes #154
## Solution
Changed `grep -q` to `grep -Eq` for patterns with alternation, removing
the backslash escapes.
## Changes
| File | Instances |
|------|-----------|
| `validate-agent.sh` | 2 |
| `hook-linter.sh` | 9 |
**Total: 11 instances**
## Testing
- [x] shellcheck passes on both modified scripts
- [x] Verified no BRE alternation patterns remain
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent b724743 commit 873a6ce
2 files changed
Lines changed: 10 additions & 10 deletions
File tree
- plugins/plugin-dev/skills
- agent-development/scripts
- hook-development/scripts
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| |||
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
0 commit comments