Skip to content

[codex] Remove eval from schema parser#286

Closed
anansutiawan wants to merge 1 commit into
23andMe:masterfrom
anansutiawan:codex/remove-parser-eval
Closed

[codex] Remove eval from schema parser#286
anansutiawan wants to merge 1 commit into
23andMe:masterfrom
anansutiawan:codex/remove-parser-eval

Conversation

@anansutiawan

Copy link
Copy Markdown

Summary

  • replace the final schema parser eval(compile(...)) step with a recursive AST constructor
  • keep the existing validated grammar for constants, validator-name references, and nested validator calls
  • add parser regression coverage for nested validator-name references and unary numeric constants

Rationale

PR #173 added AST validation as a best-effort hardening step and noted that removing eval entirely would be the stronger follow-up. This keeps the same schema syntax while avoiding runtime evaluation of schema expressions.

Validation

  • pytest yamale (169 passed)
  • ruff check yamale/syntax/parser.py yamale/syntax/tests/test_parser.py
  • bandit yamale/syntax/parser.py -q

@anansutiawan

Copy link
Copy Markdown
Author

Closing this draft and reopening from a cleaner branch and title.

@anansutiawan anansutiawan deleted the codex/remove-parser-eval branch May 12, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant