-
Notifications
You must be signed in to change notification settings - Fork 78
feat(ci): add sourcemeta/jsonschema to find linting issues #1053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ci): add sourcemeta/jsonschema to find linting issues #1053
Conversation
Signed-off-by: karan-palan <[email protected]>
|
If required, I can update the CI to have the cli in pre-commit job, and commit the auto-fixed schemas using |
|
Glad to see this! I'd like to transition us even more to the sourcemeta tool (over JsonSchemer [Ruby] and jsonschema [python]) since I suspect it's going to be more helpful with error messages. However, when I tried a while back to use it for validation, it was hitting what appeared to be a sourcemeta bug while handling our schema. Might be time to revisit after this PR gets in. And, yes, adding this to pre-commit would be great. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1053 +/- ##
=======================================
Coverage 46.05% 46.05%
=======================================
Files 11 11
Lines 4942 4942
Branches 1345 1345
=======================================
Hits 2276 2276
Misses 2666 2666
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:
|
|
@dhower-qc : this new CI is failing for all the reasons flagged in the description, I assume we'd want to start with a passing CI before this PR lands? |
Just heads up on |
Signed-off-by: karan-palan <[email protected]>
Signed-off-by: karan-palan <[email protected]>
Signed-off-by: karan-palan <[email protected]>
Signed-off-by: karan-palan <[email protected]>
Correct. We'll want to fix up the files at the same time. |
|
The CI fails as it prevents committing the changes caused by |
|
yea, add the changes in the PR here |
Signed-off-by: karan-palan <[email protected]>
Signed-off-by: karan-palan <[email protected]>

Description
ref #401 and #401 (comment)
Added the
sourcemeta/jsonschemacli as an npm dependency and created a dedicated job for JSON Schema lintingNote
I, along with Juan (JSON Schema TSC member) are defining linting rules for JSON Schema as a Part of a GSoC (Google Summer of code) project here - https://github.com/Karan-Palan/JSON-Schema-Linting, and implementing their auto-fixes here - https://github.com/sourcemeta/jsonschema/blob/main/docs/lint.markdown. We have recently added many rules
prefixing unknown keywords with x-which will be introduced in the newer JSON Schema draftsIf beneficial to the project, I suggest integrating the complete cli with it to write the best schemas and catch any errors and follow best practices. Example of an integration - https://github.com/krakend/krakend-schema/blob/main/.github/workflows/validate-json-schema.yml#L10