Developer Tools

vfmt

Venutian’s own formatter: whitespace cleanup that never changes what code does.

Released v1.0.0 · 2026-09-28
Import
use "stdlib/fmt.ven"

Venutian's own source code formatter, written in pure Venutian rather than carried over from another language's tool. It reformats a source file's spacing, indentation and layout to one consistent house style, the same style the standard library's own source already follows, so a formatted file and the standard library's own code read the same way, line by line.

vfmt.ven
print format_pass1("make  add(a,   b)\n    give a  +  b   \n")
Reference (3 functions)

API reference

format_pass1(text)

Normalizes inter-token whitespace in text without touching indentation, strings, or comments.

format_pass1("make  add(a,   b)\n    give a  +  b   \n")
:: gives: "make add(a, b)\n    give a + b\n"

format_pass2(text)

Collapses runs of blank lines in text to one, and fixes the trailing newline count.

format_pass2("a\n\n\n\n\nb\n\n\n")
:: gives: "a\n\nb\n"

format_text(text)

Runs the whole formatter over text: whitespace cleanup, then blank-line cleanup.

format_text("make add(a,  b)\n    give a + b   \n\n\n\n")
:: gives: "make add(a, b)\n    give a + b\n"

Get notified when vfmt changes

Get notified about

New versions and security advisories.

New and updated packages, once a day.

News on the math model built in Venutian.