panache-format(1)

NAME
panache-format - Format a Quarto, Pandoc, or Markdown document

SYNOPSIS
panache format [--check] [--range] [--verify] [--force-exclude] [-o|--option] [-h|--help] [-V|--version] [FILES]

DESCRIPTION
Format a Quarto, Pandoc, or R Markdown document according to Panache's formatting rules. By default, formats files in place. Use --check to verify formatting without making changes. With --verify, Panache runs parser/formatter invariants without writing changes to disk. Stdin input always outputs to stdout.

OPTIONS

--check
    Check if the file is already formatted according to Panache's rules without making any changes. If the file is not formatted, displays a diff and exits with code 1. If formatted, exits with code 0. Useful for CI/CD pipelines.

--range <START:END>
    Format only the specified line range. Lines are 1-indexed and inclusive. The range will be expanded to complete block boundaries to ensure well-formed output. For example, if you select part of a list, the entire list will be formatted. Format: --range START:END (e.g., --range 5:10 formats lines 5 through 10). Note: This feature is experimental. Range filtering may not work correctly in all cases.

--verify
    Run smoke-check invariants: (1) parser losslessness (input == parsed CST text) and (2) formatter idempotency (format(format(x)) == format(x)). When formatting files by path (including directories), --verify does not write any changes to disk. Exits with code 1 when verification fails. Deprecated: prefer `panache debug panache-format --checks all`.

--force-exclude
    Apply exclude patterns from your configuration even to files passed explicitly on the command line. By default, explicitly-named files bypass exclude patterns: the assumption is that if you asked for a specific file, you want it processed. With --force-exclude, those patterns are honored regardless. This is primarily intended for pre-commit hooks (and similar tooling), which pass changed files explicitly but should still respect the project's exclude configuration.

-o, --option <KEY=VALUE>
    Override an individual config option for this invocation, using the kebab-case key names from panache.toml. May be repeated. Takes precedence over both panache.toml and the built-in defaults. Supported keys: `line-width` (positive integer) and `wrap` (one of: reflow, sentence, preserve). Example: --option line-width=100 -o wrap=sentence. Note: this is an escape hatch for ad-hoc invocations. Prefer panache.toml so that everyone formatting the repository gets the same result.

-h, --help
    Print help (see a summary with '-h')

-V, --version
    Print version

[FILES]
    Path(s) to the input file(s) or directories to format. If not provided, or if the single argument `-` is given, reads from stdin. Supports .qmd, .md, .Rmd/.Rmarkdown, and other Markdown-based formats. When file paths are provided, the files are formatted in place by default. Stdin input always outputs to stdout. Supports glob patterns (e.g., *.md) and directories (e.g., . or docs/). Directories are traversed recursively, respecting .gitignore files. `-` cannot be combined with other paths.

VERSION
v2.48.0

SEE ALSO
panache(1), panache-parse(1), panache-lsp(1), panache-lint(1), panache-clean(1), panache-debug(1)