| Crates.io | libtlafmt |
| lib.rs | libtlafmt |
| version | 0.4.1 |
| created_at | 2025-02-23 18:17:18.916701+00 |
| updated_at | 2025-04-07 22:27:26.270829+00 |
| description | A formatter library for TLA+ specs, core of tlafmt |
| homepage | |
| repository | https://github.com/domodwyer/tlafmt |
| max_upload_size | |
| id | 1566552 |
| size | 3,675,154 |
A library crate for formatting TLA+ specs.
This crate is the formatter implementation for tlafmt.
Formatting a TLA file occurs in three phases within this crate:
Step (1) is performed when calling [ParsedFile::new()] to initialise a new
instance, and steps (2) and (3) are performed when [ParsedFile::format()]
is called, writing the output to a provided [std::io::Write] sink.
Run the tests with:
% cargo test --workspace
Some tests make use of cargo-insta.
In addition to unit tests, a corpus of example TLA specs1 are formatted and a snapshot of their output generated2 after each test run. These snapshots have to be "accepted" using cargo-insta (if their change is desirable) to cause future tests runs to pass.