Code formatters

Reference for all DeepSource code formatters, including configuration and supported languages.

Code Formatters (formerly Transformers) automatically apply formatting rules to incoming code in pull requests, maintaining consistent code style across your repository.

File-based configuration (.deepsource.toml) is optional and will be deprecated in a future release. Use Settings > Code Review in the dashboard instead.

Supported Formatters

LanguageFormatterShortcodeVersion
Pythonautopep8autopep82.0.4
PythonBlackblack24.2.0
Pythonisortisort5.13.2
Pythonyapfyapf0.40.2
PythonRuffruff0.3.2
GogofmtgofmtGo 1.21.7
Gogofumptgofumpt0.6.0
Rustrustfmtrustfmt1.7.0-nightly
JavaScriptPrettierprettier3.2.5
JavaScriptStandardJSstandardjs17.1.0
RubyRuboCoprubocop1.52.1
RubyStandardRBstandardrb1.29.0
JavaGoogle Java Formatgoogle-java-format1.17.0
ScalaScalafmtscalafmt3.5.9
C#dotnet-formatdotnet-format.NET SDK 8.0
C & C++clang-formatclang-format18.1.1
PHPPHP CS Fixerphp-cs-fixer3.51.0
KotlinKtlintktlint0.50.0
Swiftswift-formatswift-format508.0.1

Configuration

When using file-based configuration, each code formatter is defined as an entry in the [[code_formatters]] array:

[[code_formatters]]
name = "<shortcode>"
enabled = true

Replace <shortcode> with the value from the table above (e.g. black, prettier, rustfmt).

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

On this page