The semgrep-interfaces repo is synced from the main semgrep repo, so please do not submit PRs against this repo.
- If you are an OSS contributor, please submit PRs against the
cli/src/semgrep/semgrep_interfacesdirectory of the semgrep repo. - If you are internal to semgrep, please submit PRs against the
OSS/cli/src/semgrep/semgrep_interfacesdirectory of the semgrep-proprietary repo.
This repository contains IDL (Interface Definition Language) files specifying the interface between different Semgrep components (e.g., between the semgrep CLI and the playground). It also includes the schema for Semgrep rules, as both Semgrep and Semgrep App rely on this.
This repository is meant to be used as a submodule.
You may need to install opam and mypy as pre-requisites for contributing to this repository.
To get setup in this repositoty:
- install uv
- Run
make dev-setup
To update an interface:
- Make changes to the appropriate .atd file or edit
generate.py - Run
make. This will propagate that change to the respective .py, .ts, .ml, etc. - Run
make test. This will check backwards compatibility, validate schemas, and typecheck python files - Also double-check manually that the changes to the interface are still backward compatible with old versions of the CLI. For example, the Semgrep backend needs to still be able to consume data generated by Semgrep 1.50.0. See https://atd.readthedocs.io/en/latest/atdgen-tutorial.html#smooth-protocol-upgrades Note that the types related to the semgrep-core JSON output or the semgrep-core RPC do not need to be backward compatible!
The code in this repository is licensed under the terms of the LGPL 2.1 with OCaml-LGPL-linking-exception. For more information about the licensing details of Semgrep itself see our licensing page.