Uv format: Code Formatting Comes to uv (experimentally)

https://news.ycombinator.com/rss Hits: 16
Summary

uv format: Code Formatting Comes to uv (experimentally!)The latest uv release (0.8.13) quietly introduced an experimental new command that Python developers have been waiting for: uv format. This addition brings code formatting directly into uv’s toolkit, eliminating the need to juggle multiple tools for basic Python development workflows.What is uv format? The uv format command provides Python code formatting through uv’s interface. Under the hood, it calls Ruff’s formatter to automatically style your code according to consistent standards.Getting Started First, make sure you’re running uv 0.8.13 or later. If you need to upgrade, check out our guide on upgrading uv.Once upgraded, formatting your project is straightforward:The command works just like running ruff format in your project root, but through uv’s interface.Passing Arguments to Ruff You can pass additional arguments to Ruff by placing them after --:This flexibility means you can customize formatting behavior without losing uv’s conveniences.WarningSince this is an experimental feature, expect some rough edges:The command may change in future releasesIntegration with uv’s project model might evolveError handling and output formatting could improveTry out uv format in your next project and see how it fits into your development workflow. The experimental nature means your feedback could help shape how this feature evolves.

First seen: 2025-08-21 21:30

Last seen: 2025-08-22 14:14