Skip to content

Commit b97fd6f

Browse files
committed
fix(ci): use mise tasks for documentation validation
- Fix validate-required-tags.sh to use BSD-compatible sed instead of grep -P - Update GitHub workflow to use 'mise run docs:validate' instead of direct scripts - Update CLAUDE.md to recommend mise tasks as primary validation method - Maintain backward compatibility with direct script execution The grep -oP flag is a GNU extension not available in BSD grep (macOS). Replaced with sed pattern matching for cross-platform compatibility. CI now uses mise for consistency with local development workflow.
1 parent 30cf768 commit b97fd6f

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

.github/workflows/test-eql.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ jobs:
3333
steps:
3434
- uses: actions/checkout@v4
3535

36-
- name: Check documentation coverage
37-
run: |
38-
chmod +x tasks/check-doc-coverage.sh
39-
./tasks/check-doc-coverage.sh
36+
- uses: jdx/mise-action@v2
37+
with:
38+
version: 2025.1.6
39+
install: true
40+
cache: true
4041

41-
- name: Validate required Doxygen tags
42+
- name: Validate SQL documentation
4243
run: |
43-
chmod +x tasks/validate-required-tags.sh
44-
./tasks/validate-required-tags.sh
44+
mise run docs:validate
4545
4646
test:
4747
name: "Test EQL SQL components"

CLAUDE.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,17 @@ CREATE FUNCTION eql_v2.create_encrypted_index(...)
122122

123123
### Validation Tools
124124

125-
Use these scripts to verify documentation quality:
125+
Verify documentation quality:
126126

127-
- `tasks/check-doc-coverage.sh` - Check documentation coverage (should be 100%)
128-
- `tasks/validate-required-tags.sh` - Verify required tags are present
129-
- `tasks/validate-documented-sql.sh` - Validate SQL syntax
127+
```bash
128+
# Using mise (recommended - validates coverage and tags)
129+
mise run docs:validate
130+
131+
# Or run individual scripts directly
132+
tasks/check-doc-coverage.sh # Check 100% coverage
133+
tasks/validate-required-tags.sh # Verify @brief, @param, @return tags
134+
tasks/validate-documented-sql.sh # Validate SQL syntax (requires database)
135+
```
130136

131137
### Template Files
132138

tasks/validate-required-tags.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ for file in $(find src -name "*.sql" -not -name "*_test.sql"); do
2424
comment_block=$(sed -n "${start},${line_no}p" "$file" | grep "^--!" | tail -20)
2525

2626
function_sig=$(sed -n "${line_no}p" "$file")
27-
function_name=$(echo "$function_sig" | grep -oP 'CREATE FUNCTION \K[^\(]+' | xargs || echo "unknown")
27+
# Extract function name (compatible with BSD sed/grep)
28+
function_name=$(echo "$function_sig" | sed -n 's/^CREATE FUNCTION[[:space:]]*\([^(]*\).*/\1/p' | xargs || echo "unknown")
2829

2930
# Check for @brief
3031
if ! echo "$comment_block" | grep -q "@brief"; then
@@ -62,7 +63,8 @@ for file in $(find src -name "*.template"); do
6263
comment_block=$(sed -n "${start},${line_no}p" "$file" | grep "^--!" | tail -20)
6364

6465
function_sig=$(sed -n "${line_no}p" "$file")
65-
function_name=$(echo "$function_sig" | grep -oP 'CREATE FUNCTION \K[^\(]+' | xargs || echo "unknown")
66+
# Extract function name (compatible with BSD sed/grep)
67+
function_name=$(echo "$function_sig" | sed -n 's/^CREATE FUNCTION[[:space:]]*\([^(]*\).*/\1/p' | xargs || echo "unknown")
6668

6769
if ! echo "$comment_block" | grep -q "@brief"; then
6870
echo "ERROR: $file:$line_no $function_name - Missing @brief"

0 commit comments

Comments
 (0)