User Guide


All configuration for µfmt is done via the pyproject.toml file. This is the same file that is used for configuring black and µsort.

Specifying options requires adding them to the tool.ufmt namespace, following this example:

excludes = [...]

Options available are described as follows:

excludes: List[str]

Optional list of supplemental patterns of file paths to exclude from formatting. Each element must be a string following “gitignore” style matching rules. These excludes will be combined with the contents of the project root’s .gitignore file, and any file or directory path that matches any of these patterns will not be formatted.

excludes = [

This configuration would ignore the following paths when formatting a project:


  • bar/

  • foo/

  • foo/bar/