Skip to content

Commit b91b43f

Browse files
committed
chore(ci): de-Python the dogfood-gate eclexiaiser-toml validation
Estate no-Python rule: replace the gated `python3 -c` tomllib validator in the inherited RSR-template dogfood-gate.yml with a bash+grep equivalent (same invariants: project.name present, >=1 [[functions]], each with name+source). Diverges from the upstream rsr-template; the canonical fix belongs there.
1 parent cf21348 commit b91b43f

1 file changed

Lines changed: 10 additions & 25 deletions

File tree

.github/workflows/dogfood-gate.yml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -261,31 +261,16 @@ jobs:
261261
262262
echo "has_manifest=true" >> "$GITHUB_OUTPUT"
263263
264-
# Validate TOML structure using Python 3.11+ tomllib
265-
python3 -c "
266-
import tomllib, sys
267-
with open('eclexiaiser.toml', 'rb') as f:
268-
data = tomllib.load(f)
269-
project = data.get('project', {})
270-
if not project.get('name', '').strip():
271-
print('ERROR: project.name is required', file=sys.stderr)
272-
sys.exit(1)
273-
functions = data.get('functions', [])
274-
if not functions:
275-
print('ERROR: at least one [[functions]] entry is required', file=sys.stderr)
276-
sys.exit(1)
277-
for fn in functions:
278-
if not fn.get('name', '').strip():
279-
print('ERROR: function name cannot be empty', file=sys.stderr)
280-
sys.exit(1)
281-
if not fn.get('source', '').strip():
282-
print(f'ERROR: function {fn[\"name\"]} has no source path', file=sys.stderr)
283-
sys.exit(1)
284-
print(f'Valid: {project[\"name\"]} ({len(functions)} function(s))')
285-
" || {
286-
echo "::error file=eclexiaiser.toml::Invalid eclexiaiser.toml — see step output for details"
287-
exit 1
288-
}
264+
# Validate eclexiaiser.toml structure (bash + grep; no Python — estate no-Python rule).
265+
ok=1
266+
grep -qE '^[[:space:]]*name[[:space:]]*=[[:space:]]*"[^"]+"' eclexiaiser.toml || { echo "::error::project.name is required"; ok=0; }
267+
nfun=$(grep -cE '^[[:space:]]*\[\[functions\]\]' eclexiaiser.toml || true)
268+
[ "${nfun:-0}" -ge 1 ] || { echo "::error::at least one [[functions]] entry is required"; ok=0; }
269+
nname=$(grep -cE '^[[:space:]]*name[[:space:]]*=[[:space:]]*"[^"]+"' eclexiaiser.toml || true)
270+
nsrc=$(grep -cE '^[[:space:]]*source[[:space:]]*=[[:space:]]*"[^"]+"' eclexiaiser.toml || true)
271+
[ "${nname:-0}" -ge "$(( ${nfun:-0} + 1 ))" ] || { echo "::error::a function has an empty or missing name"; ok=0; }
272+
[ "${nsrc:-0}" -ge "${nfun:-0}" ] || { echo "::error::a function has an empty or missing source"; ok=0; }
273+
if [ "$ok" = 1 ]; then echo "Valid: eclexiaiser.toml (${nfun:-0} function(s))"; else echo "::error file=eclexiaiser.toml::Invalid eclexiaiser.toml"; exit 1; fi
289274
290275
- name: Write summary
291276
run: |

0 commit comments

Comments
 (0)