Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Getting Started

Badness’s main subcommands are format, lint, and lsp (with parse and init as helpers). This page walks through formatting and linting from the command line. For editor integration, see Editor Setup.

Formatting a File

Format a file in place:

badness format paper.tex

Pass several paths to format them all:

badness format intro.tex methods.tex results.tex

With no paths, badness reads from standard input and writes the formatted result to standard output—handy for piping or editor integrations:

cat paper.tex | badness format

Checking Without Writing

In CI you usually want to verify that files are already formatted rather than rewrite them. The --check flag reports which files would change and exits non-zero if any are not already formatted:

badness format --check paper.tex

Linting

lint parses each file and reports any diagnostics found, rendered with source snippets. It exits non-zero when there is at least one diagnostic:

badness lint paper.tex

Like format, it reads standard input when given no paths:

cat paper.tex | badness lint

Adjusting Layout

The formatter takes a few style options on the command line:

badness format --line-width 100 --indent-width 4 --wrap preserve paper.tex

See the CLI Reference for every flag and the Wrap Modes page for what --wrap controls.