Skip to content

Lint Semgrep rules with meta-rules

Bence Nagy requested to merge underyx/semgrep:underyx-main-patch-66408 into main

What does this MR do?

Hey! I work at r2c, and we have a couple meta rules that look for common mistakes within Semgrep rule definition YAML files.

This commit adds all of r2c's meta rules to this project's CI pipeline.

Things to note:

  • You might not want this in your CI at all, which is perfectly fine. I mainly just wanted to let you know these exist.
  • This points to a mutable registry ID, so these meta-rules could change at any time.
  • I didn't know if I can just add this command right at the start of your existing CI script, or you'd like to keep that script more modular; I ended up just doing the former as a minimum lovable solution 😛.
  • I added a CI job using the returntocorp/semgrep-agent:v1 Docker image instead of using the existing test script, cause that script runs in an environment with a Semgrep CLI version that doesn't have YAML linting support yet.

Since I'm not even sure if you'd like this change to be made, I'm not checking off anything from the checklist below.

What are the relevant issue numbers?

N/A

Does this MR meet the acceptance criteria?

Edited by Bence Nagy

Merge request reports