-
Notifications
You must be signed in to change notification settings - Fork 9
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
Extend the definition of 'analyzer' in Semgrep rules #286
Conversation
Backwards compatibility summary:
|
Can you also update rule_schema_v2.atd ? |
I updated it. It's fairly complicated due an ATD adapter that can't be fully generic. It's explained in the comments along with a possible improvement in ATD that would simplify this. I created an ATD issue here: ahrefs/atd#413 (I don't think we really need this but it's good to start a discussion somewhere) I still have to check if this OCaml code compiles and works (I don't have the impression that we're testing it here). |
186a9d4
to
512935d
Compare
This PR extends the Semgrep rule schema in accordance with the work I did on the OCaml side. The PR is https://github.com/semgrep/semgrep-proprietary/pull/1641 and I'm going to push my work to it very soon.
This PR also adds JSON Schema validation tests. They're useful to check that the JSON Schema is valid, that it validates valid Semgrep rules, and rejects invalid Semgrep rules - without having to rely on another git repo to test this.
test plan:
make test
This will run
check-jsonschema
.make setup
will ask the user to install it if it's missing.make setup && make
to update the generated code after editing a.atd
file (TODO: have a CI check)For example, the Semgrep backend need to still be able to consume data generated
by Semgrep 1.17.0.
See https://atd.readthedocs.io/en/latest/atdgen-tutorial.html#smooth-protocol-upgrades