KadTech Start a project
Selected work/Tooling

code-normalizer

A formatter that proves it changed nothing but layout.

Two token streams compared, with only whitespace differing

Problem

Reformatting code risks changing behaviour without anyone noticing.

Constraints

Approach

Rewrite comments, whitespace, blank-line rhythm and stray Unicode across file types.

Re-read the output and compare it token by token with the input.

Architecture

Source file
Normalize layout
Re-read and tokenise
Token comparison
Accept or reject

Result

Stack

Node.js

Have a system like this to build, move or fix?

← KadTech ToolsAll workSwitchboard →