Skip to content

feat(cli): add leo fmt command#29124

Merged
JoshuaBatty merged 1 commit intomasterfrom
josh/fmt_cli
Feb 13, 2026
Merged

feat(cli): add leo fmt command#29124
JoshuaBatty merged 1 commit intomasterfrom
josh/fmt_cli

Conversation

@JoshuaBatty
Copy link
Collaborator

@JoshuaBatty JoshuaBatty commented Feb 13, 2026

Adds a leo fmt command to the CLI, emulating the behaviour of cargo fmt:

  • leo fmt — silently formats all .leo files in src/ (or a given path). No output on success, just like cargo fmt.
  • leo fmt --check — prints a colored diff of unformatted files and exits with code 1, matching the cargo fmt --check output format.
  • Supports formatting individual files or entire directories.

Also fixes constructor() spacing in leo-fmt (was emitting constructor () with a spurious space), deduplicates workspace members in Cargo.toml, and adds an integration test covering both fmt and fmt --check.

Here is an example of running leo fmt --check

Screenshot 2026-02-13 at 12 48 25 pm

Part of #28579

Corresponding documentation PR: ProvableHQ/leo-docs-source#568

@JoshuaBatty JoshuaBatty marked this pull request as draft February 13, 2026 00:51
@JoshuaBatty JoshuaBatty self-assigned this Feb 13, 2026
@JoshuaBatty JoshuaBatty added tooling 🖥️ CLI Anything related to the Leo CLI. leo fmt Anything related the Leo formatter labels Feb 13, 2026
JoshuaBatty added a commit to ProvableHQ/leo-docs-source that referenced this pull request Feb 13, 2026
Add CLI documentation for the new `leo fmt` command, including
check mode usage and screenshot. Also add missing `synthesize`
entry to the CLI overview.

See ProvableHQ/leo#29124
JoshuaBatty added a commit to ProvableHQ/leo-docs-source that referenced this pull request Feb 13, 2026
Add CLI documentation for the new `leo fmt` command, including
check mode usage and screenshot. Also add missing `synthesize`
entry to the CLI overview.

See ProvableHQ/leo#29124
Adds a `leo fmt` command emulating `cargo fmt` behaviour: silent on
success, colored diffs on `--check`. Includes integration test and
fixes constructor() spacing in leo-fmt.
@JoshuaBatty JoshuaBatty requested a review from a team February 13, 2026 02:10
@JoshuaBatty JoshuaBatty marked this pull request as ready for review February 13, 2026 02:11
Copy link
Collaborator

@mitchmindtree mitchmindtree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@JoshuaBatty JoshuaBatty merged commit 4e27e94 into master Feb 13, 2026
5 checks passed
@JoshuaBatty JoshuaBatty deleted the josh/fmt_cli branch February 13, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🖥️ CLI Anything related to the Leo CLI. leo fmt Anything related the Leo formatter tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants