Black vs Spotless
Black
black.readthedocs.ioSpotless
github.comSide by side
| Figure | Black | Spotless |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | Yes |
| Open source | — | — |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| Self-hosted | Yes | — |
| Plans published | 1 | 2 |
| Spec score · Code Formatting Tools | 8.7 (#1) | 7.3 (#28) |
| Editor integrations | The documentation describes integrations for editors including PyCharm, Vim, Neovim, Visual Studio Code, and Sublime Text. | The README links Spotless integrations for VS Code and IntelliJ. |
| License | Black is licensed under the MIT license. | The GitHub repository identifies its license as Apache-2.0. |
| Purpose | Black is an opinionated formatter for Python code that follows PEP 8. | Spotless formats source code and can check files for formatting violations or apply fixes. |
Plans
In their own words
Black
Black is a free, MIT-licensed formatter for Python code that follows PEP 8. It reformats whole files in place and uses a default line length of 88 characters. Its limited style choices are intended to keep code consistent across projects; indentation style cannot be configured. After formatting, Black checks whether the abstract syntax tree remains effectively equivalent and raises an error if the check fails. Install it with pip; it requires Python 3.10 or newer. The documentation lists editor integrations including Emacs, PyCharm, IntelliJ IDEA, Vim, Neovim, Visual Studio Code and Sublime Text, as well as GitHub Actions and doctest workflows. Notebook formatting is available with the jupyter extra, though Black skips cells containing certain magics or invalid syntax. It also includes blackd, an HTTP server that binds to localhost by default. Black is primarily a command-line tool and does not provide a Python interface. Stable releases preserve formatting within the same calendar year when the options match.
Spotless
Spotless formats source code and can check files for formatting violations or apply fixes. It supports languages and formats including Java, Kotlin, JavaScript, Python, SQL, YAML, and Markdown, with formatter options such as Google Java Format, ktlint, Prettier, ESLint, Black, and ScalaFmt. The project integrates with Gradle and Maven and links to an external SBT integration. Its README links to VS Code and IntelliJ integrations. Spotless lists automatic idempotency and encoding safeguards for Gradle, Maven, and SBT. Git-based features include ratcheting from a Git reference for Gradle and Maven, and Git-defined line endings for all three build tools. Some capabilities, including ratcheting and fast incremental formatting, are unavailable in SBT. The repository identifies the license as Apache-2.0. Spotless is available for Linux, macOS, and Windows. DiffPlug directs questions to its forum and lists a technical support contact; security disclosures can be sent to [email protected]. Its plan listing includes a free plan at free, billed free forever with no registration required, and also lists a free trial.