The following usage documentation is for the Semgrep command line tool.
semgrep --help for command line options.
semgrep may exit with the following exit codes:
0: Semgrep ran successfully and found no errors (or did find errors, but the
--errorflag is not set)
1: Semgrep ran successfully and found issues in your code (and the
--errorflag is set)
2: Semgrep failed
3: Semgrep failed to parse a file in the specified language
4: Semgrep encountered an invalid pattern
5: Semgrep config is not valid yaml
6: Rule with
--dangerously-allow-arbitrary-code-execution-from-ruleswas not set. See
7: All rules in config are invalid. If semgrep is run with
--strictthen this exit code is returned when any rule in the configs are invalid.
8: Semgrep does not understand specified language
9: Semgrep exceeded match timeout. See
10: Semgrep exceeded max memory while matching. See
11: Semgrep encountered a lexical error when running rule on a file.
Find what you needed in this doc? Join the Slack group to ask the maintainers and the community if you need help.