fix(cli): pluralize validate-schema counts like list-schemas does - #85
Open
Thorsrud22 wants to merge 1 commit into
Open
Thorsrud22 wants to merge 1 commit into
Thorsrud22 wants to merge 1 commit into
Conversation
validate-schema printed the literal "field(s)" and "example(s)" regardless of count. list-schemas already uses real singular/plural logic in the same file; apply the same approach here so the summary reads "1 field" or "9 fields, 1 example". Update the existing assertion and add a test for the singular case. Fixes pranjalparmar#82 Co-Authored-By: Claude Fable 5.1 <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.
What this does
Fixes #82.
validate-schemaprinted the literalfield(s)/example(s)regardless of count.list_schemas()in the same file already does real singular/plural handling, so this applies the same approach tovalidate_schema()for both counts:Tests: the existing
test_validate_schema_valid_bundledassertion now checks for the real plural (and thatfield(s)is gone), and a newtest_validate_schema_singular_countscovers the1 field, 1 examplecase. Changelog entry added under Unreleased / Fixed.Checklist
pytest -v), not just the file touched — 97 passed on Python 3.12docs/and/orREADME.mdif a CLI flag,Schema/Fieldoption, or output shape changed — no docs quote this message, so only CHANGELOG.md changedCONTRIBUTING.mdif unsure)🤖 Generated with Claude Code