Skip to content
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

Validate JSON rules #613

Merged
merged 2 commits into from
Jan 31, 2025
Merged

Validate JSON rules #613

merged 2 commits into from
Jan 31, 2025

Conversation

muodov
Copy link
Member

@muodov muodov commented Jan 29, 2025

I borrowed some code from the remote config repo to validate JSON files against the existing TS types

@muodov muodov requested a review from sammacbeth January 29, 2025 13:48
@muodov muodov added the tests Add or improve existing tests label Jan 29, 2025
@muodov muodov requested a review from noisysocks January 29, 2025 13:50
@noisysocks
Copy link
Contributor

Very nice! Love it.

I think we could go a even further and split this script into two scripts:

  1. one that generates a JSON schema file, which we commit to the repo, and;
  2. one that validates our rules against the JSON schema.

This way we can reference the committed JSON schema using $schema at the top of each rule and developers get autocompletion and hints in their IDE when editing rules.

I’ve done exactly this over in #615 which has your PR set as the base. What do you think?

@muodov muodov merged commit f812e39 into main Jan 31, 2025
9 checks passed
@muodov muodov deleted the validate-json-rules branch January 31, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Add or improve existing tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants