Skip to content

update semgrep config with full details #106

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

Merged
merged 5 commits into from
Oct 14, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 28 additions & 16 deletions docs/tools/semgrep.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,45 @@ sidebar_label: Semgrep
description: CodeRabbit's guide to Semgrep.
---

[Semgrep](https://semgrep.dev/) is a static analysis tool designed to scan code for security vulnerabilities and code quality issues..
[Semgrep](https://semgrep.dev/) is a static analysis tool designed to scan code
for security vulnerabilities and code quality issues.

## Configuration

Semgrep uses a YAML style configuration file.

Semgrep supports the following config files:

- User-defined config file set at `reviews.tools.semgrep.config_file` in your
project's `.coderabbit.yaml` file or setting the "Review → Tools → Semgrep →
Config File" field in CodeRabbit's settings page.

> Due to licensing CodeRabbit does not ship with the
> [community-created Semgrep rules](https://github.com/returntocorp/semgrep-rules),
> but you're free to use these in your own `semgrep.yml` config file.

> **NOTE: CodeRabbit will only run Semgrep if your repository contains a Semgrep
> config file. In addition you must also define the path to this file in
> `.coderabbit.yaml` or config UI.**

## Links

- [Semgrep CLI Reference](https://semgrep.dev/docs/cli-reference)
- [Writing Semgrep Rules for Config Files](https://semgrep.dev/docs/running-rules)

## Files

Semgrep will run on the following files and extensions:

- `Apex`
- `Bash`
- `Bash`
- `.c`
- `.cpp`
- `.cs`
- `.clj`
- `.dart`
- `Dockerfile`
- `.ex`
- `.ex`
- `.html`
- `.go`
- `.java`
Expand All @@ -36,7 +60,7 @@ Semgrep will run on the following files and extensions:
- `.py`
- `.r`
- `.rb`
- `.rs`
- `.rs`
- `.scala`
- `Scheme`
- `.sol`
Expand All @@ -48,15 +72,3 @@ Semgrep will run on the following files and extensions:
- `.xml`
- `ERB`
- `Jinja`

## Configuration

Semgrep uses a YAML style configuration file.

Semgrep supports the following config files:

- User-defined config file set at `reviews.tools.semgrep.config_file` in your project's `.coderabbit.yaml` file or setting the "Review → Tools → Semgrep → Config File" field in CodeRabbit's settings page.

## Links

- [Semgrep Cli Reference](https://semgrep.dev/docs/cli-reference)