Metadata-Version: 2.1
Name: format-blocks
Version: 0.1.2
Summary: A library for building code formatters
Home-page: https://github.com/Spacerat/format-blocks
Author: Joseph Atkins-Turkish
Author-email: spacerat3004@gmail.com
Requires-Python: >=3.6,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Dist: typing_extensions (>=3.7.4,<4.0.0)
Project-URL: Repository, https://github.com/Spacerat/format-blocks
Description-Content-Type: text/markdown

# Format Blocks

Format Blocks is a Python library for building code formatters.

## Usage

Format Blocks provides a number of 'block' objects which know how to arrange text in various ways,
such as `LineBlock` which arranges elements on one line, and `StackBlock` which stacks them across
lines, and `WrapBlock` which wraps inserts line breaks at the margin.

However, the most import block is `ChoiceBlock`. ChoiceBlock accepts multiple formatting options,
and allows for the solver to pick the choices which _minimize the overall formatting cost_.

See the tests for some examples!

## Origins

Format Blocks is a fork of the guts of Google's R Formatter, [rfmt](https://github.com/google/rfmt).
Rfmt was structured as a formatting library with an R implementation, _almost_ entirely decoupled. To
create Format Blocks, I just did some final decoupling, then polished up the code and wrote some
extra features and tests.

