See: Description
| Class | Description |
|---|---|
| Dimension |
One of the eight readability dimensions with its effective weight, 0-100 score and a one-line explanation.
|
| Finding |
One traceable scoring observation: which rule fired, where, how much it
costs, whether the formatter can do anything about it, and a
position-independent
fingerprint that survives a
reformat so two runs can be aligned finding-by-finding. |
| Finding.Builder |
Mutable builder; every rule produces findings through it.
|
| Improvement |
One entry of the ranked improvement list: fix every fixable finding of
rule and gain about estGain total points. |
| PrettyScore |
PrettyScore: scores the readability of an already formatted SQL text
against a style
ScoreProfile and explains every deduction. |
| ScoreProfile |
A style profile: the target layout the scorer measures against.
|
| ScoreReport | |
| ScoreReport.GateCheck |
One fidelity gate check.
|
| ScoreReport.ParseInfo |
Parse / engine facts recorded for the scored text.
|
| Enum | Description |
|---|---|
| ScoreProfile.ClauseAlign | |
| ScoreProfile.JoinIndent |
Where JOIN clause keywords sit: on the clause spine, or at the block's content column (ISF style).
|
| ScoreProfile.JoinOnIndent | |
| Severity |
Severity of a
Finding. |
Entry point: PrettyScore. Public
API: PrettyScore, ScoreProfile, ScoreReport and the
value objects Finding, Dimension, Improvement,
Severity. The analysis, rules, explain and
json sub-packages are implementation detail.
The scorer reads an already formatted SQL text plus its dialect, builds
a lexical fact base through the pp2 annotators (so a syntax error never
blocks scoring), applies rules across eight dimensions (spine, indent,
width, density, alignment, consistency, grouping, comments) and returns a
0-100 score, the attainable score (unfixable deductions added back), the
ratio the formatter improvement loop targets, every finding with a
position-independent fingerprint, and a ranked improvement list mapped to
formatter options / renderer components.
While the profiles carry calibration: heuristic-v0 the numbers
are comparable only within one profile on one corpus.
Design: sqlformat/docs/pretty_score/sql-pretty-score-java-tool-plan-2026-09-02_f5.md.
CLI: gudusoft.gsqlparser.demos.prettyscore.PrettyScoreMain.