Skip to content

Commit 40a0600

Browse files
committed
Refreshed to RAD Formatter V2.7.963 Alpha
1 parent c93e238 commit 40a0600

11 files changed

Lines changed: 159 additions & 36 deletions

File tree

‎index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ <h2><b>rad</b>Formatter</h2>
112112
into a full syntax tree, formats from real structure, and validates that
113113
nothing beyond whitespace and casing ever changes &mdash; fully offline,
114114
with your source never leaving your machine.</p>
115-
<p class="meta"><span>IDE plugin</span><span>CLI</span><span>CST-aware</span><span>65 options</span><span>CI-ready</span><span>offline</span></p>
115+
<p class="meta"><span>IDE plugin</span><span>CLI</span><span>CST-aware</span><span>68 options</span><span>CI-ready</span><span>offline</span></p>
116116
</div>
117117
<div class="go">
118118
<a class="btn primary" href="radFormatter/index.html">Learn more</a>

‎radFormatter/docs/config-options.html‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title>Configuration options - radFormatter</title>
7-
<meta name="description" content="Complete reference for all 65 radFormatter configuration options across eight sections: casing, spacing, indent, lineBreaks, reshaping, alignment, output, and conditional.">
7+
<meta name="description" content="Complete reference for all 68 radFormatter configuration options across eight sections: casing, spacing, indent, lineBreaks, reshaping, alignment, output, and conditional.">
88
<link rel="canonical" href="https://radprogrammer.com/radFormatter/docs/config-options.html">
99
<meta property="og:type" content="website">
1010
<meta property="og:site_name" content="RAD Programmer">
1111
<meta property="og:title" content="Configuration options - radFormatter">
12-
<meta property="og:description" content="Complete reference for all 65 radFormatter configuration options across eight sections: casing, spacing, indent, lineBreaks, reshaping, alignment, output, and conditional.">
12+
<meta property="og:description" content="Complete reference for all 68 radFormatter configuration options across eight sections: casing, spacing, indent, lineBreaks, reshaping, alignment, output, and conditional.">
1313
<meta property="og:url" content="https://radprogrammer.com/radFormatter/docs/config-options.html">
1414
<meta property="og:image" content="https://radprogrammer.com/radFormatter/assets/og-radformatter.png">
1515
<meta property="og:image:width" content="1200">
@@ -103,7 +103,7 @@ <h1>Configuration options reference</h1>
103103
applies the chosen profile's defaults &mdash; with no profile selected, that
104104
is the built-in <strong>Default</strong> profile.</p>
105105

106-
<p>There are <strong>65 options across eight sections</strong>:
106+
<p>There are <strong>68 options across eight sections</strong>:
107107
<code>casing</code>, <code>spacing</code>, <code>indent</code>,
108108
<code>lineBreaks</code>, <code>reshaping</code>, <code>alignment</code>,
109109
<code>output</code>, and <code>conditional</code>.</p>
@@ -172,6 +172,7 @@ <h2 id="indent" class="anchor-heading"><code>indent</code></h2>
172172
<tr><td>indent.tabWidth</td><td>integer</td><td>0</td><td>Display width (in columns) used only to <strong>measure</strong> existing tab-indented source when computing visual columns for right-margin / soft-break decisions. <code>0</code> = same as <code>indent.size</code>; <code>&gt;0</code> = an explicit editor tab-stop width. Does not affect emitted indentation</td></tr>
173173
<tr><td>indent.style</td><td>"spaces" | "tabs" | "asIs"</td><td>"asIs"</td><td>Indent character: <code>spaces</code> always uses spaces; <code>tabs</code> uses one tab per structural level (continuation/alignment stay spaces); <code>asIs</code> (Default) preserves the source's indent character &mdash; the first line with leading indentation decides (leading tab &rarr; tabs, leading space &rarr; spaces), none &rarr; spaces. Depth is always recomputed; only the character is preserved</td></tr>
174174
<tr><td>indent.directives</td><td>"asIs" | "column0" | "structural"</td><td>"asIs"</td><td>Compiler-directive indentation: <code>asIs</code> preserves source indent (Default); <code>column0</code> forces the left margin (FormatterExe/Embarcadero); <code>structural</code> indents to surrounding depth</td></tr>
175+
<tr><td>indent.labelIndent</td><td>"bodyLevel" | "blockOpener" | "column0" | "asIs"</td><td>"bodyLevel"</td><td>Indentation of a stand-alone goto-label line (<code>findAgain:</code> alone on its line): <code>bodyLevel</code> keeps it at the statement column (Default); <code>blockOpener</code> outdents it one level to its enclosing block-opener column (Embarcadero); <code>column0</code> forces the left margin; <code>asIs</code> preserves the source column. A same-line <code>label: stmt;</code> is unaffected</td></tr>
175176
<tr><td>indent.continuationSize</td><td>integer</td><td>2</td><td>Extra spaces added to wrapped / continuation lines</td></tr>
176177
<tr><td>indent.anchorBased</td><td>bool</td><td>false</td><td>When wrapping, align continuation lines under the column after the opening delimiter instead of using a fixed continuation indent</td></tr>
177178
<tr><td>indent.maxColumn</td><td>integer</td><td>0</td><td><code>0</code> = no cap; <code>&gt;0</code> = clamp any computed indent to this column</td></tr>
@@ -197,6 +198,7 @@ <h2 id="linebreaks" class="anchor-heading"><code>lineBreaks</code></h2>
197198
<tr><td>lineBreaks.afterLabel</td><td><a href="#tri-state">tri-state</a></td><td>"asis"</td><td>Newline after a statement label's colon</td></tr>
198199
<tr><td>lineBreaks.lineAfterSemicolon</td><td>bool</td><td>false</td><td>Force a line break after every statement-terminating semicolon, so each statement lands on its own line. Add-only (never removes user breaks) and CST-aware &mdash; parameter-list and declaration separators are left untouched</td></tr>
199200
<tr><td>lineBreaks.usesMode</td><td>"preserve" / "singleLine" / "onePerLine"</td><td>"preserve"</td><td>How <code>uses</code> clauses are laid out: unchanged, collapsed to one line, or one unit per line</td></tr>
201+
<tr><td>lineBreaks.sectionKeywordJoin</td><td>"preserve" / "join" / "break"</td><td>"preserve"</td><td>Placement of a section introducer (<code>type</code>/<code>const</code>/<code>var</code>) that follows a visibility specifier (<code>private type</code>, <code>strict private type</code>): <code>preserve</code> keeps the author's layout (never splits an inline pair, never joins a broken one); <code>join</code> collapses the pair onto one line; <code>break</code> forces them onto separate lines. The atomic compound directives (<code>strict private</code>, <code>class var</code>/<code>class function</code>/&hellip;) are always intact regardless. An intervening comment (<code>private {note} type</code>) leaves the pair as authored under every mode</td></tr>
200202
</tbody>
201203
</table>
202204

@@ -234,7 +236,8 @@ <h2 id="output" class="anchor-heading"><code>output</code></h2>
234236
<table class="data">
235237
<thead><tr><th scope="col">Option</th><th scope="col">Type</th><th scope="col">Default</th><th scope="col">Effect</th></tr></thead>
236238
<tbody>
237-
<tr><td>output.lineEnding</td><td>"platform" / "crlf" / "lf" / "cr" / "detect"</td><td>"platform"</td><td><code>platform</code> uses the platform default line ending (CRLF on Windows), regardless of the source; <code>crlf</code> / <code>lf</code> / <code>cr</code> force that terminator; <code>detect</code> keys off the source file's first line break (<code>\r\n</code>&rarr;CRLF, <code>\n</code>&rarr;LF, <code>\r</code>&rarr;CR; none &rarr; platform) and applies it uniformly, so a LF-only file stays LF</td></tr>
239+
<tr><td>output.lineEnding</td><td>"platform" / "crlf" / "lf" / "cr" / "detect"</td><td>"platform"</td><td><code>platform</code> uses the platform default line ending (CRLF on Windows), regardless of the source; <code>crlf</code> / <code>lf</code> / <code>cr</code> force that terminator; <code>detect</code> keys off the source file's first line break (<code>\r\n</code>&rarr;CRLF, <code>\n</code>&rarr;LF, <code>\r</code>&rarr;CR; none &rarr; platform) and applies it uniformly, so a LF-only file stays LF. The NoOp profile uses <code>detect</code></td></tr>
240+
<tr><td>output.trimTrailingWhitespace</td><td>bool</td><td>true</td><td>When <code>true</code>, end-of-line whitespace is removed (the renderer rebuilds each line from its tokens). When <code>false</code>, a line's trailing whitespace is preserved verbatim &mdash; both the run after the last token and a whitespace-only blank line's spaces. The NoOp profile sets this <code>false</code> so it is a true byte-for-byte pass-through; other profiles keep it <code>true</code></td></tr>
238241
<tr><td>output.rightMargin</td><td>integer</td><td>0</td><td>Wrap column. <code>0</code> = disabled. When <code>&gt;0</code>, lines longer than this are wrapped at their declared soft-break points (call arguments, parameter lists, <code>uses</code> commas, binary operators, inheritance lists, and so on)</td></tr>
239242
<tr><td>output.maxEmptyLines</td><td>integer</td><td>-1</td><td><code>-1</code> = unlimited; <code>0+</code> = maximum consecutive blank lines</td></tr>
240243
<tr><td>output.strictMode</td><td>bool</td><td>true</td><td>When <code>true</code>, an unclassifiable feature is a validation error; when <code>false</code>, unknown constructs pass through untouched</td></tr>
@@ -263,7 +266,7 @@ <h2 id="conditional" class="anchor-heading"><code>conditional</code></h2>
263266
<table class="data">
264267
<thead><tr><th scope="col">Option</th><th scope="col">Type</th><th scope="col">Default</th><th scope="col">Effect</th></tr></thead>
265268
<tbody>
266-
<tr><td>conditional.mode</td><td>"activeBranch" / "allBranches" / "preserveConditionals"</td><td>"activeBranch"</td><td><code>activeBranch</code> formats the branch selected by the build context and preserves inactive branches verbatim (directives included); <code>allBranches</code> parses every branch as one stream and formats best-effort (no build context used); <code>preserveConditionals</code> leaves every conditional line exactly as authored &mdash; any physical line holding a conditional directive, or lying between an opener and its matching closer, is emitted verbatim &mdash; while everything outside conditional regions is reformatted</td></tr>
269+
<tr><td>conditional.mode</td><td>"activeBranch" / "allBranches" / "preserveConditionals"</td><td>"activeBranch"</td><td><code>activeBranch</code> formats the branch selected by the build context and preserves inactive branches verbatim (directives included); <code>allBranches</code> parses every branch as one stream and formats best-effort (no build context used); <code>preserveConditionals</code> leaves every conditional line exactly as authored &mdash; any physical line holding a conditional directive, or lying between an opener and its matching closer, is emitted verbatim &mdash; while everything outside conditional regions is reformatted (it folds against the deterministic default context only to obtain a parse stream; that branch choice never affects the verbatim regions). Values parse case-insensitively</td></tr>
267270
<tr><td>conditional.compilerVersion</td><td>string</td><td>""</td><td>Build context (used by <code>activeBranch</code> only): compiler version as a product name (<code>"Delphi 12"</code>), an alias, or a <code>VERxxx</code> define. Empty = the parser's latest known version (deterministic)</td></tr>
268271
<tr><td>conditional.platform</td><td>string</td><td>""</td><td>Build context: a target-platform enum name (<code>Win32Target</code>, <code>Win64Target</code>, &hellip;). Empty = <code>Win32Target</code> (deterministic default)</td></tr>
269272
<tr><td>conditional.defines</td><td>string array</td><td>[]</td><td>Build context: conditional symbols to define (a <code>NAME=VALUE</code> entry keeps only <code>NAME</code>; folding is name-only)</td></tr>
@@ -279,7 +282,7 @@ <h2 id="default-config" class="anchor-heading">Full default configuration</h2>
279282
<p>This is exactly what <code>-writeDefaultConfig</code> emits (the
280283
<strong>Default</strong> profile).</p>
281284
<pre class="term"><code>{
282-
<span class="j">"schemaVersion"</span>: "3.3",
285+
<span class="j">"schemaVersion"</span>: "3.4",
283286
<span class="j">"casing"</span>: {
284287
<span class="j">"keywords"</span>: "asis",
285288
<span class="j">"numbers"</span>: "asis",
@@ -306,6 +309,7 @@ <h2 id="default-config" class="anchor-heading">Full default configuration</h2>
306309
<span class="j">"tabWidth"</span>: 0,
307310
<span class="j">"style"</span>: "asIs",
308311
<span class="j">"directives"</span>: "asIs",
312+
<span class="j">"labelIndent"</span>: "bodyLevel",
309313
<span class="j">"continuationSize"</span>: 2,
310314
<span class="j">"anchorBased"</span>: false,
311315
<span class="j">"maxColumn"</span>: 0,
@@ -318,6 +322,7 @@ <h2 id="default-config" class="anchor-heading">Full default configuration</h2>
318322
},
319323
<span class="j">"lineBreaks"</span>: {
320324
<span class="j">"keepUser"</span>: true,
325+
<span class="j">"sectionKeywordJoin"</span>: "preserve",
321326
<span class="j">"beforeSingleInstr"</span>: "asis",
322327
<span class="j">"beforeBegin"</span>: "asis",
323328
<span class="j">"betweenElseAndIf"</span>: false,
@@ -346,6 +351,7 @@ <h2 id="default-config" class="anchor-heading">Full default configuration</h2>
346351
},
347352
<span class="j">"output"</span>: {
348353
<span class="j">"lineEnding"</span>: "platform",
354+
<span class="j">"trimTrailingWhitespace"</span>: true,
349355
<span class="j">"rightMargin"</span>: 0,
350356
<span class="j">"maxEmptyLines"</span>: -1,
351357
<span class="j">"emptyLines"</span>: {
@@ -426,6 +432,10 @@ <h3 id="tri-state" class="anchor-heading">Tri-state <code>(yes / no / asis)</cod
426432
</tbody>
427433
</table>
428434

435+
<p class="crumb" style="margin:3em 0 0;text-align:center">
436+
<a href="https://github.com/radprogrammer/radFormatter/releases">Configuration options as of radFormatter v2.7.963 (Alpha) &middot; config schema 3.4 &mdash; see release notes</a>
437+
</p>
438+
429439
</main>
430440
</div>
431441

‎radFormatter/docs/embarcadero-style-guide.html‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,13 @@ <h2 id="using" class="anchor-heading">Using the profile</h2>
122122
<p><a class="dl" href="radFormatter.Embarcadero.json" download>Download radFormatter.Embarcadero.json</a></p>
123123
<div class="note">Unlike the conservative <strong>Default</strong> profile,
124124
<code>Embarcadero</code> performs active formatting: it lowercases keywords,
125-
normalizes spacing, reflows <code>begin</code>/<code>end</code> and control
126-
bodies (<code>lineBreaks.keepUser</code> is <code>false</code>), and wraps
127-
at a 160-column margin.</div>
125+
normalizes spacing, puts <code>begin</code>/<code>end</code> and
126+
control-statement bodies on their own lines, and wraps at a 160-column
127+
margin. It <strong>preserves your existing line breaks</strong>
128+
(<code>lineBreaks.keepUser</code> is <code>true</code>) &mdash; the style
129+
guide makes no call on un-wrapping &mdash; so it adds the structural breaks
130+
above and wraps over-margin lines, but never collapses or reflows layout you
131+
already chose.</div>
128132
<p>See the <a href="config-options.html">configuration options reference</a>
129133
for the meaning of every key.</p>
130134

@@ -157,7 +161,7 @@ <h2 id="mapping" class="anchor-heading">Settings mapped to the style guide</h2>
157161
</table>
158162

159163
<h2 id="structural" class="anchor-heading">Handled automatically by the CST indent engine</h2>
160-
<p>Several style-guide layout rules need no option &mdash; the
164+
<p>Several style-guide layout rules need no option in v2 &mdash; the
161165
concrete-syntax indent engine produces them structurally:</p>
162166
<ul>
163167
<li>Unit-level keywords (<code>unit</code>, <code>uses</code>,
@@ -195,7 +199,8 @@ <h2 id="notes" class="anchor-heading">Notes</h2>
195199
<li><code>output.lineEnding</code> is <code>"platform"</code> (the platform
196200
default line ending; CRLF on Windows). Set it to <code>"crlf"</code>,
197201
<code>"lf"</code>, or <code>"cr"</code> if your project standardizes on
198-
one.</li>
202+
one, or <code>"detect"</code> to preserve each file's existing
203+
convention.</li>
199204
<li>The profile leaves all <code>reshaping.*</code> options off, so it
200205
will not force call arguments, enums, arrays, or inheritance lists onto
201206
separate lines. The 160-column <code>rightMargin</code> still wraps

0 commit comments

Comments
 (0)