Home Explore Blog CI



nixpkgs

1st chunk of `doc/packages/treefmt.section.md`
5786ba18fdc0e67ac54850003043f899293c4740befe2e9000000001000003ce
# 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
```


Title: Treefmt: Streamlining Code Formatting
Summary
This section introduces `treefmt`, a tool designed to simplify applying formatters to projects. It highlights the `treefmt` package and its configuration using the module system, with links to documentation and options. It also mentions the alternative configuration method using `treefmt-nix`. The section concludes with a reference to configurable attributes for `withConfig` or `evalConfig`.