Commit e729b17
style: suppress grep stderr in test-agent-trigger.sh (#150)
## Description
Add `2>/dev/null` to suppress potential stderr output from grep when
counting example blocks in `test-agent-trigger.sh`.
```bash
# Before
EXAMPLE_COUNT=$(echo "$DESCRIPTION" | grep -c '<example>' || echo 0)
# After
EXAMPLE_COUNT=$(echo "$DESCRIPTION" | grep -c '<example>' 2>/dev/null || echo 0)
```
The `|| echo 0` already handles grep's non-zero exit code when no
matches are found. This change additionally suppresses any error
messages grep might emit to stderr in edge cases.
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Documentation update (improvements to README, CLAUDE.md, or
component docs)
- [x] Refactoring (code change that neither fixes a bug nor adds a
feature)
- [ ] Configuration change (changes to .markdownlint.json, plugin.json,
etc.)
## Component(s) Affected
- [ ] Commands (`/plugin-dev:*`)
- [x] Skills (methodology and best practices)
- [ ] Agents (requirements-assistant)
- [ ] Hooks (UserPromptSubmit)
- [ ] Documentation (README.md, CLAUDE.md, SECURITY.md)
- [ ] Configuration (.markdownlint.json, plugin.json, marketplace.json)
- [ ] Issue/PR templates
- [ ] Other (please specify):
## Motivation and Context
Minor robustness improvement identified during code review. While
unlikely to cause issues in practice, suppressing stderr is a defensive
coding practice that prevents unexpected error messages from appearing
in output.
## How Has This Been Tested?
**Test Configuration**:
- Claude Code version: Latest
- GitHub CLI version: 2.x
- OS: macOS
- Testing repository: N/A
**Test Steps**:
1. Run `test-agent-trigger.sh` with a valid agent file
2. Verify example count is correctly reported
3. Verify no stderr output appears
## Checklist
### General
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
(if applicable)
- [x] My changes generate no new warnings or errors
### Documentation
- [ ] I have updated the documentation accordingly (README.md,
CLAUDE.md, or component docs)
- [ ] I have updated YAML frontmatter (if applicable)
- [ ] I have verified all links work correctly
### Markdown
- [x] I have run `markdownlint` and fixed all issues
- [x] My markdown follows the repository style (ATX headers, dash lists,
fenced code blocks)
- [ ] I have verified special HTML elements are properly closed
(`<example>`, `<commentary>`, etc.)
### Component-Specific Checks
N/A - This is a shell script utility, not a command/skill/agent.
### Testing
- [ ] I have tested the plugin locally with `cc --plugin-dir
plugins/plugin-dev`
- [ ] I have tested the full workflow (if applicable)
- [ ] I have verified GitHub CLI integration works (if applicable)
- [ ] I have tested in a clean repository (not my development repo)
### Version Management (if applicable)
- [ ] I have updated version numbers in both `plugin.json` and
`marketplace.json` (if this is a release)
- [ ] I have updated CHANGELOG.md with relevant changes
## Screenshots (if applicable)
N/A
## Additional Notes
This is a minor robustness improvement. The original code was
functional; this change is purely defensive.
## Reviewer Notes
**Areas that need special attention**:
- None - this is a trivial change
**Known limitations or trade-offs**:
- None
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent 19468ec commit e729b17
1 file changed
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
0 commit comments