feat: inline --rule specs and rules YAML from stdin#6
Merged
Conversation
`sentinel validate` now accepts repeatable `--rule check:column[:args]` flags and can read its rules YAML from stdin via `--rules -`. Inline specs cover not_null, not_empty, unique, min, max, between, and regex; the custom check stays YAML-only for multi-line SQL. Enables coding agents to compose quick checks without writing a rules file to disk, while still allowing composition with a YAML file when warnings, thresholds, or custom SQL are needed. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--rule check:column[:args]flag tovalidate— coversnot_null,not_empty,unique,min,max,between,regex.customstays YAML-only (needs multi-line SQL).--rules -to read rules YAML from stdin. Combines with--rule; empty stdin is tolerated when inline rules are present._2,_3, … suffixes.error(YAML remains required forwarning,threshold, andcustom).Why
Coding agents calling sentinel via Bash can now compose quick checks inline without first writing a rules file to disk. YAML stays the path for the richer surface (severity/threshold/custom SQL).
Test plan
cargo fmt --checkcleancargo clippy -- -D warningscleancargo test— 100 tests pass (20 new parser + disambiguator tests)--helpshows multi-line arity examples🤖 Generated with Claude Code