Skip to content

Run formatters automatically when "use" is invoked #1713

@nathanjmcdougall

Description

@nathanjmcdougall

When working on #1652, it became clear that pyproject-fmt will format the default uv init repo structure.

If we call the function to use pyproject-fmt, we should invoke the tool for its side effects.

We should add an abstract method to Tool called apply. By default, it will be no-op, i.e. just have pass.

But the PyprojectFmtTool should over-ride this to invoke its command via subprocess. We should have an appropriate message via tick print.

We should do the exact same for Ruff format (not the linter auto-fixes).

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions