Enhance json-lint command with Blueprint support#2363
Conversation
See westonruter/post-date-modified#23 Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR enhances the JSON validation script to support Blueprint-specific requirements and improves the overall user experience. The script is renamed from validate-json-schema.js to validate-json.js to better reflect its dual purpose of JSON syntax validation and schema validation.
Changes:
- Renamed script from
validate-json-schema.jstovalidate-json.jswith enhanced functionality - Added Blueprint file size validation (max 100 KB) to meet WordPress.org plugin directory requirements
- Improved error handling to collect all errors before exiting instead of failing on first error
- Enhanced output formatting with consistent filename-first messages and status emojis
Reviewed changes
Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| package.json | Updated lint-json script reference to point to renamed validate-json.js |
| bin/validate-json.js | New enhanced validation script with Blueprint support, better error handling, improved types, timeout protection for schema fetching, and comprehensive JSON syntax validation |
| bin/validate-json-schema.js | Removed old validation script (replaced by validate-json.js) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #2363 +/- ##
=======================================
Coverage 69.17% 69.17%
=======================================
Files 90 90
Lines 7708 7708
=======================================
Hits 5332 5332
Misses 2376 2376
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
adamsilverstein
left a comment
There was a problem hiding this comment.
Nice! Left some small feedback, otherwise looks good to me.
|
@adamsilverstein Thanks! I don't see the feedback though. |
I took the
bin/validate-json-schema.jswhich was introduced in #2325 and incorporated it into my post-date-modified plugin. I then iterated on it there in westonruter/post-date-modified#23 to:Look at 05033f3 for a better diff of the changes, prior to renaming the file.
Before
After
Use of AI Tools
Copilot and Gemini were both used to help author some changes. See commits at westonruter/post-date-modified#23