Skip to content

Commit

Permalink
Document in README and add schema test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobotb committed Mar 4, 2024
1 parent 6569ab9 commit a20c76b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/verify-schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on: push
name: Check that the JSON schema for the configuration file matches the examples
jobs:
integration_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v1
- run: npm install -g pajv
- run: make -C schema
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,22 @@ ignore-gitignore: false
max-file-size-kb: 100
```

## Configuration file schema

There is a JSON Schema definition for the `static-analysis.datadog.yml` in the `schema` subdirectory.

You can use it to check the syntax of your configuration file:

1. Install https://www.npmjs.com/package/pajv (`npm install -g pajv`)
2. Execute `pajv validate -s schema/schema.json -d path/to/your/static-analysis.datadog.yml`

There are some examples of valid and invalid configuration files in the [`schema/examples/valid`](schema/examples/valid)
and [`schema/examples/invalid`](schema/examples/invalid) subdirectories, respectively. If you make changes to the JSON
Schema, you can test them against our examples:

1. Install https://www.npmjs.com/package/pajv (`npm install -g pajv`)
2. Execute `make -C schema`

## Other Tools

### datadog-export-rulesets
Expand Down

0 comments on commit a20c76b

Please sign in to comment.