mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-12 00:12:30 +02:00
fix: reject whitespace-only command/field values in CI validators, add 10 tests
validate-hooks.js: whitespace-only command strings now fail validation validate-agents.js: whitespace-only model/tools values now fail validation
This commit is contained in:
parent
5398ac793d
commit
2dbba8877b
3 changed files with 150 additions and 2 deletions
|
|
@ -58,7 +58,7 @@ function validateAgents() {
|
|||
}
|
||||
|
||||
for (const field of REQUIRED_FIELDS) {
|
||||
if (!frontmatter[field]) {
|
||||
if (!frontmatter[field] || (typeof frontmatter[field] === 'string' && !frontmatter[field].trim())) {
|
||||
console.error(`ERROR: ${file} - Missing required field: ${field}`);
|
||||
hasErrors = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ function validateHookEntry(hook, label) {
|
|||
hasErrors = true;
|
||||
}
|
||||
|
||||
if (!hook.command || (typeof hook.command !== 'string' && !Array.isArray(hook.command))) {
|
||||
if (!hook.command || (typeof hook.command !== 'string' && !Array.isArray(hook.command)) || (typeof hook.command === 'string' && !hook.command.trim())) {
|
||||
console.error(`ERROR: ${label} missing or invalid 'command' field`);
|
||||
hasErrors = true;
|
||||
} else if (typeof hook.command === 'string') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue