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.

Dashboard configuration is the default — no .deepsource.toml file is needed for new repositories. TOML-based configuration is an optional alternative. See the Core analyzers reference for details.

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

If your repository uses 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