Skip to content

Commit 5cde1b7

Browse files
igerberclaude
andcommitted
Fix grep PCRE patterns to use POSIX character classes
Replace \s with [[:space:]] and drop \b in grep patterns across skill files and TODO.md. The PCRE tokens silently fail to match in BRE/ERE mode, defeating the purpose of the pattern checks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d43fd0a commit 5cde1b7

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

.claude/commands/pre-merge-check.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ If any methodology files changed, run these pattern checks on the **changed meth
3333

3434
**Check A — Inline inference computation**:
3535
```bash
36-
grep -n "t_stat\s*=\s*[^#]*/ *se" <changed-methodology-files> | grep -v "safe_inference"
36+
grep -n "t_stat[[:space:]]*=[[:space:]]*[^#]*/ *se" <changed-methodology-files> | grep -v "safe_inference"
3737
```
3838
Flag each match: "Consider using `safe_inference()` from `diff_diff.utils` instead of inline t_stat computation."
3939

4040
**Check B — Zero-SE fallback to 0.0 instead of NaN**:
4141
```bash
42-
grep -En "if.*(se|SE).*>.*0.*else\s+(0\.0|0)\b" <changed-methodology-files>
42+
grep -En "if.*(se|SE).*>.*0.*else[[:space:]]+(0\.0|0)" <changed-methodology-files>
4343
```
4444
Flag each match: "SE=0 should produce NaN, not 0.0, for inference fields."
4545

.claude/commands/push-pr-update.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ When the working tree is clean but commits are ahead, scan for secrets in the co
127127
```
128128

129129
If methodology files are present, run Checks A and B from `/pre-merge-check` Section 2.1 on those files:
130-
- **Check A**: `grep -n "t_stat\s*=\s*[^#]*/ *se" <methodology-files> | grep -v "safe_inference"`
131-
- **Check B**: `grep -En "if.*(se|SE).*>.*0.*else\s+(0\.0|0)\b" <methodology-files>`
130+
- **Check A**: `grep -n "t_stat[[:space:]]*=[[:space:]]*[^#]*/ *se" <methodology-files> | grep -v "safe_inference"`
131+
- **Check B**: `grep -En "if.*(se|SE).*>.*0.*else[[:space:]]+(0\.0|0)" <methodology-files>`
132132

133133
If warnings are found:
134134
```

.claude/commands/submit-pr.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ Determine if this is a fork-based workflow:
139139
```
140140

141141
If methodology files are present, run Checks A and B from `/pre-merge-check` Section 2.1 on those files:
142-
- **Check A**: `grep -n "t_stat\s*=\s*[^#]*/ *se" <methodology-files> | grep -v "safe_inference"`
143-
- **Check B**: `grep -En "if.*(se|SE).*>.*0.*else\s+(0\.0|0)\b" <methodology-files>`
142+
- **Check A**: `grep -n "t_stat[[:space:]]*=[[:space:]]*[^#]*/ *se" <methodology-files> | grep -v "safe_inference"`
143+
- **Check B**: `grep -En "if.*(se|SE).*>.*0.*else[[:space:]]+(0\.0|0)" <methodology-files>`
144144

145145
If warnings are found:
146146
```

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Several estimators return `0.0` for t-statistic when SE is 0 or undefined. This
7575

7676
**How to find them:**
7777
```bash
78-
grep -n "t_stat\s*=\s*[^#]*/ *se" diff_diff/*.py | grep -v "safe_inference"
78+
grep -n "t_stat[[:space:]]*=[[:space:]]*[^#]*/ *se" diff_diff/*.py | grep -v "safe_inference"
7979
```
8080

8181
**Migration pattern:**

0 commit comments

Comments
 (0)