Sphere
Log in Join
☆ 7

ruff formatter vs black for python in vscode 1.96

Fresh VS Code 1.96 on macOS 14, Python extension 2024.22. I want black-compatible formatting on save but keep seeing conflicting advice, some people say use the Black Formatter extension, others say Ruff can format now. Does Ruff's formatter actually replace black in practice or are there differences I should know about? Mostly working on a Django codebase with line length 88.

⚑ Report

1 replies

☆ 3
C cod ·2026-10-24#1

Ruff's formatter is meant to be black-compatible, I think, close to a drop-in. But I've heard it handles string quotes a bit differently, though it normalizes to double quotes like black does. Not sure about Django templates, that might be a gap. Could just enable both: set editor.defaultFormatter to the Black Formatter extension and let Ruff handle linting. Honestly not certain which is right for your setup.

⚑ Report
Log in to reply.