Home Explore Blog Models CI



nixpkgs

doc/packages/treefmt.section.md
1e764a1c51d9f7a9e6fa50b6f554ded8d5e042a61c08353000000003000003ce
# treefmt {#treefmt}

[treefmt](https://github.com/numtide/treefmt) streamlines the process of applying formatters to your project, making it a breeze with just one command line.

The [`treefmt` package](https://search.nixos.org/packages?channel=unstable&show=treefmt)
provides functions for configuring treefmt using the module system, which are [documented below](#sec-functions-library-treefmt), along with [their options](#sec-treefmt-options-reference).

Alternatively, treefmt can be configured using [treefmt-nix](https://github.com/numtide/treefmt-nix).

```{=include=} sections auto-id-prefix=auto-generated-treefmt-functions
treefmt-functions.section.md
```

## Options Reference {#sec-treefmt-options-reference}

The following attributes can be passed to [`withConfig`](#pkgs.treefmt.withConfig) or [`evalConfig`](#pkgs.treefmt.evalConfig):

```{=include=} options
id-prefix: opt-treefmt-
list-id: configuration-variable-list
source: ../treefmt-options.json
```


Chunks
5cc2071f (1st chunk of `doc/packages/treefmt.section.md`)
Title: treefmt: Project Formatting Automation and Configuration
Summary
This section introduces treefmt, a tool designed to simplify the application of formatters to a project using a single command line. It explains that the treefmt Nix package provides functions for configuration via the module system, with documentation for these functions and their options provided. It also mentions treefmt-nix as an alternative configuration method and points to an options reference for attributes applicable to `withConfig` and `evalConfig`.