Skip navigation links
General SQL Parser Documentation | ← Back to Docs

Package gudusoft.gsqlparser.pp.score

PrettyScore: readability scoring for formatted SQL.

See: Description

Package gudusoft.gsqlparser.pp.score Description

PrettyScore: readability scoring for formatted SQL.

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.

Skip navigation links
General SQL Parser Documentation | ← Back to Docs

Copyright © 2026 Gudu Software. All rights reserved. | Back to Documentation | Full Documentation Site