Core analyzers

Configuration reference for all DeepSource analyzers, including code analysis, coverage, and vulnerability scanning.

This page documents the configuration options for every DeepSource analyzer. Each analyzer can be enabled and configured through the dashboard under Settings > Code Review — no configuration file is needed.

Dashboard configuration (default)

DeepSource auto-detects languages in your repository, and all analysis settings are managed through Settings > Code Review in the dashboard. No .deepsource.toml file is needed for new repositories.

TOML configuration (optional)

If your repository contains a .deepsource.toml file, DeepSource reads it and uses it to configure analysis. You can disable TOML-based configuration for a repository under Settings > Preferences.

Supported languages

AnalyzerSupported versionsStatus
Go≤1.26GA
Rust≤1.93GA
Java8–25GA
Scala2.x, 3.xGA
C#1–14GA
JavaScriptUp to ES2025, TypeScript up to 6.0GA
PHP7.0–8.5GA
Python2.7, 3.x (up to 3.12)GA
Ruby2.0–3.3GA
C & C++C99–C17, C++98–C++23GA
Swift5.1–5.9GA
Kotlin1.0–2.1GA
DockerN/AGA
ShellN/AGA
SQLN/AGA
TerraformN/AGA

TOML file reference

If your repository contains a .deepsource.toml file, DeepSource reads it and uses it to configure analysis. The file supports the following top-level fields:

version

  • Type: Integer
  • Presence: mandatory
  • Description: The version of the configuration file format. Currently, the only supported value is 1.
version = 1

exclude_patterns

  • Type: Array of Strings
  • Presence: optional
  • Description: Glob patterns to exclude files from analysis (e.g. test fixtures, generated code, vendor directories).
exclude_patterns = [
  "migrations/**",
  "**/examples/**",
  "vendor/**"
]

test_patterns

  • Type: Array of Strings
  • Presence: optional
  • Description: Glob patterns to identify test files. Helps reduce false positives by distinguishing application code from test code.
test_patterns = [
  "tests/**",
  "test_*.py",
  "**/*_test.go"
]

analyzers

  • Type: Array of Tables
  • Presence: mandatory (at least one analyzer)
  • Description: Each entry defines an analyzer to run. Every entry supports name (String, mandatory), enabled (Boolean, optional, defaults to true), dependency_file_paths (Array of Strings, optional), and meta (Table, optional — analyzer-specific options documented below).

code_formatters

  • Type: Array of Tables
  • Presence: optional
  • Description: Each entry defines a code formatter to run on pull requests. Supports name (String, mandatory) and enabled (Boolean, optional). See the Code Formatters reference for available formatters.

The code_formatters key replaces the legacy transformers key. Both are supported for backward compatibility.

Complete example

version = 1

exclude_patterns = [
  "vendor/**"
]

test_patterns = [
  "tests/**"
]

[[analyzers]]
name = "python"
enabled = true

  [analyzers.meta]
  runtime_version = "3.x.x"

Python

Analyzer shortcode: python

Code Analysis

The Python analyzer detects bugs, anti-patterns, security issues, and style violations in Python 2 and Python 3 code. It also supports type checking via mypy.

Configuration options

OptionTypeDefaultDescription
runtime_versionString"3.x.x"Python runtime version ("2.x.x" or "3.x.x")
max_line_lengthInteger88Maximum allowed line length (min 79)
skip_doc_coverageArray["module", "magic", "init"]Artifacts to skip for doc coverage (module, magic, init, class, nonpublic)
type_checkerStringNoneType checking analyzer ("mypy")
additional_builtinsArrayNoneAdditional built-in names from user or third-party modules
cyclomatic_complexity_thresholdString"medium"Risk threshold: low, medium, high, very-high, critical

Example

[[analyzers]]
name = "python"
enabled = true

  [analyzers.meta]
  runtime_version = "3.x.x"

For coverage tool setup, see Code coverage > Python. For supported vulnerability target files, see Vulnerability scanning > Python.


Go

Analyzer shortcode: go

Code Analysis

The Go analyzer detects bugs, anti-patterns, and security issues in Go code. It automatically resolves dependencies via supported package managers.

Configuration options

OptionTypeDefaultDescription
import_rootStringNoneRepository placed at $GOPATH/src/{import_root}. Required if not using Go Modules.
import_pathsArrayNoneOverride auto-detected import paths
skip_doc_coverageArrayNoneArtifacts to skip for doc coverage (file)
dependencies_vendoredBooleanfalseSkip dependency installation if vendored
build_tagsArrayNoneBuild tags for conditional compilation
cgo_enabledBooleantrueWhether packages use CGo
cyclomatic_complexity_thresholdString"medium"Risk threshold: low, medium, high, very-high, critical

import_path (String) is deprecated. Use import_root and let the analyzer auto-detect import_paths instead.

Example

[[analyzers]]
name = "go"