prettyplease

Format syn::File ASTs into readable Rust source with prettyplease::unparse.

3|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/yankeeinlondon/rusty-biscuit --skill prettyplease
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prettyplease
Source: https://github.com/yankeeinlondon/rusty-biscuit/tree/main/.claude/skills/prettyplease
Command: npx skills add https://github.com/yankeeinlondon/rusty-biscuit --skill prettyplease

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Formats generated Rust code by turning syn::File ASTs into readable source using prettyplease::unparse, avoiding external rustfmt tooling and ensuring stable output for code generated at build time or by macros.

Core Features & Use Cases

  • Library-based formatting: format in-process without spawning a formatter binary.
  • AST-focused: operates on syn::File and handles common generated-code scenarios (proc macros, build scripts, code generators).
  • Deterministic output: yields consistent formatting suitable for reproducible code generation.

Quick Start

Use prettyplease to format a syn::File AST into readable Rust source.

Frequently Asked Questions about prettyplease

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format generated Rust code from a syn AST without rustfmt?

Format a syn::File AST into readable Rust source code in-process by applying prettyplease::unparse, which avoids spawning external rustfmt binaries during macro expansion or build script execution.

What is the best way to format Rust code generated by proc-macros deterministically?

Deterministically format Rust code generated by proc-macros by passing a syn::File AST to prettyplease::unparse, yielding consistent, reproducible output without invoking external rustfmt tooling.

Can I format Rust code in-process during build scripts without external tooling?

Yes, you can format Rust code in-process during build scripts by applying prettyplease to a syn::File AST. It operates as a library without spawning formatter binaries, making it suitable for build-time code generation environments.

Does prettyplease work with syn::File ASTs for code generator expanders?

Yes, prettyplease works with syn::File ASTs for code generator expanders. It takes a syn::File input and applies unparse to produce formatted Rust source, handling common generated-code scenarios including AST transforms and macro expanders.

Why use library-based Rust code formatting instead of rustfmt for generated code?

Use library-based Rust code formatting instead of rustfmt for generated code when external tooling is unavailable or undesirable. prettyplease formats syn::File ASTs in-process, ensuring deterministic output for proc-macros and build scripts without requiring external formatter binaries.