A repository that ships Semgrep rules keeps, next to each rule X.yaml, the
sample X.py or X.cs it is tested on, written to hold the flaws the rule
must find. Vendored packs bring their own manifests (a pom.xml naming old
Struts and Spring versions). Scanned as product code, the samples become
code findings and the manifests SBOM components with CVEs.
test_data_dirs now also lists a directory with a Semgrep rule file and a
sample of the same name (Semgrep's test convention), with everything below
it, never the tree itself. A YAML file counts as a rule file when it has a
rules list naming id, languages and message, and is at most 1 MiB. As test
data, the pack leaves the working copy before any stage, and findings an
earlier scan stored there close as test data (#904).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>