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
| Language | Formatter | Shortcode | Version |
|---|---|---|---|
| Python | autopep8 | autopep8 | 2.0.4 |
| Python | Black | black | 24.2.0 |
| Python | isort | isort | 5.13.2 |
| Python | yapf | yapf | 0.40.2 |
| Python | Ruff | ruff | 0.3.2 |
| Go | gofmt | gofmt | Go 1.21.7 |
| Go | gofumpt | gofumpt | 0.6.0 |
| Rust | rustfmt | rustfmt | 1.7.0-nightly |
| JavaScript | Prettier | prettier | 3.2.5 |
| JavaScript | StandardJS | standardjs | 17.1.0 |
| Ruby | RuboCop | rubocop | 1.52.1 |
| Ruby | StandardRB | standardrb | 1.29.0 |
| Java | Google Java Format | google-java-format | 1.17.0 |
| Scala | Scalafmt | scalafmt | 3.5.9 |
| C# | dotnet-format | dotnet-format | .NET SDK 8.0 |
| C & C++ | clang-format | clang-format | 18.1.1 |
| PHP | PHP CS Fixer | php-cs-fixer | 3.51.0 |
| Kotlin | Ktlint | ktlint | 0.50.0 |
| Swift | swift-format | swift-format | 508.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 = trueReplace <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.