Skip to content
CAI
Software that uses CAICheck a score

com-lihaoyi/PPrint

53.3

Adequate · 6 November 2026

1.2k

lines of production code

Scala

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

PPrint is a Scala library for pretty-printing data structures and types, supporting Scala 2.13, Scala 3, and Scala Native. It provides a refactored engine that renders case classes with field names, handles complex type representations, and offers configurable output for debugging and logging. The system features lazy, streaming capabilities to manage large structures efficiently and includes utilities for colored or black-and-white inline printing.

How it got here

2017 — PPrint rebrand and Mill migration

4 changes.

The project was rebranded from TPrint to PPrint and migrated its build infrastructure from SBT to Mill, while adding Scala Native support. Documentation was updated to reflect the new API, including streaming capabilities and context-aware debugging features.

2019 — pretty-printing engine overhaul

3 changes.

The pprint library underwent a major refactoring of its core rendering engine, introducing a lazy AST and a new Renderer class to improve line wrapping, indentation, and configuration options. This period also added Scala 2.13-specific support for including field names in case class rendering and expanded the test suite to cover these new behaviors.

2020–2023 — TPrint overhaul and Scala 3 support

5 changes.

The TPrint macro implementation was completely rewritten to simplify logic and improve type rendering for complex Scala types. A new Scala 3-specific implementation was introduced using quotes and TypeRepr, accompanied by comprehensive test suites for both versions to verify type printing and horizontal formatting behavior.

Features

Add Scala 3-specific pprint implementation

Introduces a new Scala 3 implementation of the pprint library (located in pprint/src-3) to support Scala 3 syntax and reflection APIs. This includes ProductSupport for formatting case classes (with specific handling for field names and 1-arity cases), TPrintImpl for compile-time type printing using Scala 3 quotes and TypeRepr, and CollectionName to access internal collection class names.

pprint/src-3 · high confidence

Include field names in Product rendering for Scala 2.13

When pretty-printing Scala 2.13 case classes (Products), the output now includes field names alongside their values. Field names that are not valid Scala identifiers are automatically wrapped in backticks to ensure correct syntax. This change introduces Scala 2.13-specific support files to handle product element iteration and collection name resolution, replacing previous reflection-based approaches for determining collection class names.

pprint/src-2.13 · high confidence

Behavioural changes

Major overhaul of pretty-printing engine and API

The pprint library has been significantly refactored to improve rendering quality and API usability. The core printing logic has been rewritten using a lazy AST (Abstract Syntax Tree) and a new \Renderer\ class, enabling better handling of line wrapping, indentation, and truncation for large structures. The \PPrinter\ class now exposes explicit configuration options for width, height, indent, unicode escaping, and field name display, along with dedicated \log\ and \err.log\ methods for debugging that include source file and line metadata. Additionally, new string interpolators \pp\ (colored) and \bw\ (black-and-white) have been added for convenient inline pretty-printing, and the library now robustly handles \null\ returns from \toString\ methods and renders common collection subclasses (like \HashMap\) using their standard factory names (e.g., \Map\).

pprint/src · high confidence

Overhaul of TPrint macro implementation

The internal implementation of the TPrint macro has been completely rewritten to simplify logic and improve type rendering. This change introduces a new \TPrintImpl.scala\ file that handles the recursive traversal of Scala types, including specific support for function types (up to arity 22), tuples, infix operators, and type bounds. The new implementation also adds logic to correctly resolve symbol lookups in enclosing scopes and handle refined types, ensuring more accurate and cleaner string representations of complex types in the pprint output.

pprint/src-2 · high confidence

Project rebranded to PPrint with Mill build system migration

The project has been renamed from TPrint to PPrint, updating the README and repository identity. The build system has migrated from the legacy build.sc format to build.mill, utilizing Mill version 1.0.0-RC1. This change includes the addition of a .gitignore file, an MIT LICENSE, and a mill wrapper script to standardize the build environment.

(repo-wide) · high confidence

Updated PPrint documentation with new API examples and streaming details

The README has been updated to include comprehensive documentation for the PPrint library, specifically highlighting the new \pprint.log\ function for context-aware debugging and the \pprint.tokenize\ method for streaming output. The guide now demonstrates how to configure printing options like width and height, and explains the library's lazy, streaming capabilities for handling large data structures without memory issues.

readme · high confidence

Test coverage

Added Scala 3-specific tests for TPrint and Horizontal formatting; Added commented-out JVM-specific TPrint tests; Added test suite for pprint 2.13-specific rendering behaviors; Added tests for TPrint and horizontal printing behavior.

Dependencies

Added Scala Native support and updated dependencies

The project now supports Scala Native, allowing users to run the library on native platforms. This change includes updating the build configuration to support Scala 2.13.0 final and porting the build to Mill, as indicated by the commit messages. Additionally, the package name has been renamed from \ammonite.pprint\ to \pprint\, and the \fansi\ dependency has been upgraded.

(dependencies) · medium confidence

Update build infrastructure and version to 0.9.6

The project build has been updated to use SBT version 1.9.7, and the Scalatex documentation plugin (version 0.3.11) has been added to the build plugins. The library version constant has been set to 0.9.6.

project · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 51 → 53 (+1.9)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 69 → 69 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 37 → 41 (+4.1)
  • Readiness 61 → 61 (+0.0)
  • Security 65 → 65 (+0.0)

Resolved (2)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no project overview (README.md)

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

com-lihaoyi/PPrint was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 66733cc563c1a4c8d694b3daba69ab643a50dd79 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-410a2463fa58.