Introduction

Dixtra is an opinionated formatter for Scala 3. Its primary goal is visual consistency and clarity across constructs.

Other Scala formatters let you tune typographic details: where the parentheses go, how the indentation works, when a comma is written. Dixtra treats the code as having visual features that must be formatted as a unit, and gives you fewer settings, so that the result is consistent by construction.

Design Principles

These are the principles used to develop and design Dixtra:

Format visual features

Dixtra targers visual features for formattings:

and as such they are formatted as a unit. For example, a definition site with multiple parameter groups will uniformly format the parameters.

Consistency across formattings

The same visual feature must format the same, everywhere in the code. For example, if a selector chain breaks after 3 selectors, it always does so.

One concept per line

Strongly favour having one "concept" per line. This can be a selector chain, the name of a function, a member, a parameter and more. Scala allows so much flexibility that the code can become easily unreadable.

Optinionated

Ultimately, this is a personal project aimed at solving long standing frustrations with the existing formatters and, as such, it strongly favours my views on stlyling.

Three ways to use it

All three run the same formatter, with the same configuration.

Where to go next