-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathyadf.ini
More file actions
311 lines (265 loc) · 12.1 KB
/
Copy pathyadf.ini
File metadata and controls
311 lines (265 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
; YADF -- Yet Another Delphi Formatter -- configuration file
;
; Without --ini, YADF reads the F profile mapped in %APPDATA%\YADF\profiles.ini
; (by default %APPDATA%\YADF\yadf.ini; manage profiles in YADFSetup or the IDE
; options page). To use a specific INI file, pass
;
; yadf <input> --ini <path-to-other.ini>
;
; on the command line. CLI flags override INI values; INI values override
; YADF's compiled-in defaults.
;
; Every option is listed below with its compiled-in default and a short
; description. Boolean values are case-insensitive (true/false, 1/0, yes/no).
[Format]
; ===================================================================
; Line layout
; ===================================================================
; MaxLen
; Hard cap on emitted line length, in characters. Lines containing
; string literals or // line-comments may extend past this without
; being broken (those exceptions are by design -- breaking inside a
; literal would change behavior).
MaxLen=180
; Indent
; Number of spaces per indent level. Standard Delphi style is 2.
Indent=2
; TabWidth
; How many spaces a leading TAB character expands to when YADF
; normalizes leading whitespace. Tabs inside strings and comments
; are preserved verbatim.
TabWidth=4
; MaxBlankLines
; Cap on consecutive blank lines anywhere in the output. The blank-
; line floor options below (BlanksBeforeSection/Method/Type) win
; over this cap when they ask for more blanks than this allows.
MaxBlankLines=1
; ReflowLines
; When true, drop user line breaks where structurally non-essential
; and re-flow content to fill MaxLen. When false, original line
; breaks are preserved (only re-indented/aligned).
ReflowLines=true
; ===================================================================
; Uses clauses (uses, contains, requires)
; ===================================================================
; UsesAlwaysBreak
; When true (default), every uses-style clause is rendered
; one identifier per line, comma-first, with the closing
; semicolon on its own line at the same column as the commas:
;
; uses
; System.SysUtils
; , System.Classes
; ;
;
; When false, the clause stays on a single line if it fits in
; MaxLen and contains no `in 'path'` items; otherwise it breaks
; (and the closing semicolon still goes on its own line).
UsesAlwaysBreak=true
; UsesCommaLast
; Style of the BROKEN (multi-line) uses clause. Only affects the
; broken form; the inline single-line form is unchanged.
; false (default) -- comma-FIRST true -- comma-LAST
; uses uses
; System.SysUtils System.SysUtils,
; , System.Classes System.Classes;
; ;
; Comma-first (default) keeps diffs clean when units are added or
; removed (each line is a complete row including its comma).
UsesCommaLast=false
; ===================================================================
; Block-end labels and unclosed-block markers
; ===================================================================
; LabelLongBlocks
; When true, long begin/record/case/try/asm/object blocks get a
; trailing `// while`, `// procedure`, etc. comment so the closing
; `end;` is self-describing.
LabelLongBlocks=true
; LabelMinLines
; Minimum block size, in output lines, before LabelLongBlocks adds
; a trailing label.
LabelMinLines=15
; MarkUnclosed
; When true, force-closed openers (a `begin` with no matching
; `end`, etc.) emit a `// TODO -oYADF : '<keyword>' on line N has
; no matching 'end'` marker so they show up in the IDE's To-Do list.
MarkUnclosed=false
; ===================================================================
; Whitespace
; ===================================================================
; TrimTrailing
; Strip trailing whitespace from every emitted line. Strongly
; recommended on; turning it off is mostly for diff debugging.
TrimTrailing=true
; ===================================================================
; Capitalization
; ===================================================================
; LowercaseKeywords
; Lowercase reserved keywords (begin, end, if, else, var, ...).
LowercaseKeywords=true
; UpperHexNumbers
; Uppercase hex digits in $NN literals and the exponent letter
; in floats: $FF, 1E5.
UpperHexNumbers=true
; UpperDirectives
; Uppercase compiler-directive names: {$IFDEF}, {$DEFINE}, ...
UpperDirectives=true
; FirstOccCasing
; Normalize identifier casing to the first occurrence in the
; file. Pascal is case-insensitive, so this is semantically safe.
FirstOccCasing=true
; ===================================================================
; Blank-line floor (insert before a section, never after)
; Defaults are 0; floor wins over MaxBlankLines.
; ===================================================================
; BlanksBeforeSection
; Minimum blank lines before each `interface` / `implementation` /
; `initialization` / `finalization` keyword.
BlanksBeforeSection=0
; BlanksBeforeMethod
; Minimum blank lines before each top-level procedure / function /
; constructor / destructor declaration.
BlanksBeforeMethod=0
; BlanksBeforeType
; Minimum blank lines before each `type` keyword.
BlanksBeforeType=0
; ===================================================================
; Assignment-operator spacing
; ===================================================================
; AssignNoSpaceBefore
; When true, no space before `:=` (e.g. `X:= 1`).
; When false, one space (e.g. `X := 1`).
AssignNoSpaceBefore=true
; AssignSpaceAfter
; When true, exactly one space after `:=`.
AssignSpaceAfter=true
; ===================================================================
; Pass-2 column alignment
; ===================================================================
; AlignConstEquals
; Align `=` in adjacent `const NAME = VALUE;` lines.
AlignConstEquals=true
; AlignTypeColon
; Align `:` in adjacent declaration lines (var/field/parameter).
AlignTypeColon=true
; AlignDeclSemicolons
; After AlignTypeColon, align the trailing `;` on adjacent declaration
; lines so the semicolons line up in a column too. Set this AND
; AlignTypeColon to false for plain `Name: Type;` declarations.
AlignDeclSemicolons=true
; AlignSmartAssign
; When adjacent assignment lines share the same token shape (same
; sequence of operators/punctuation, identifier names may differ),
; pad every common anchor (`.`, `:=`, `(`, `,`, `)`, `;`) to its
; max column so they line up.
AlignSmartAssign=true
; AlignMaxColumn
; Skip Pass-2 alignment for any anchor that would push a line past
; this column (prevents one outlier from forcing huge padding on
; every neighbor). Also caps the shared column used by
; AlignMatchingShapes and by trailing-comment alignment. Wide
; tables (e.g. long record-constant arrays) align out of the box at
; the default below; very wide ones may still need it raised -- if
; any anchor would cross this column the whole run is left
; untouched. Raised from 100 to 140 (2026-05-17) so AlignMatchingShapes
; aligns typical record-constant tables without a per-project bump.
AlignMaxColumn=140
; AlignMatchingShapes
; Generalises AlignSmartAssign beyond `:=` lines. When two or more
; ADJACENT lines share an identical structural skeleton (same
; sequence of operators/punctuation in the same order -- identifier
; names, strings, and numbers are ignored), every shared anchor is
; padded to a common column so the lines form a neat table. Applies
; anywhere -- record-constant arrays, declarations, repeated calls
; -- not just constant definitions. Lines whose skeletons differ
; are never touched. Set false to keep the old `:=`/const-only
; behaviour.
AlignMatchingShapes=true
; AlignShapeMinAnchors
; Floor on how many structural anchors a non-`:=` run's shared
; skeleton must have before AlignMatchingShapes will align it. This
; stops trivial 1-2 symbol shapes (e.g. every `Foo(x);` or `a.b;`)
; from triggering noisy column padding across ordinary code. Lines
; that already contain `:=` are unaffected by this floor.
AlignShapeMinAnchors=3
; AlignCommentMaxShift
; In a shape-matched run where EVERY line carries a trailing `//`
; comment, pull those comments to one shared column -- but only
; when no line has to move more than this many spaces to get
; there. Comments further apart than this are left where the
; author put them (avoids tearing a ragged gap across the block).
; The shared comment column is still bounded by AlignMaxColumn.
; Set 0 to disable trailing-comment alignment entirely.
AlignCommentMaxShift=7
; ===================================================================
; Output / backup destinations
; ===================================================================
; ResultDir
; When non-empty, every formatted file is written to
; <ResultDir>\<basename-of-source>
; and the source file is left untouched. Leave empty (the default)
; for in-place formatting.
; CLI equivalents: --of <folder> sets, --no-o clears.
ResultDir=
; Backup
; Backups are OPT-IN. With Backup=false (default), in-place formatting
; overwrites the source with no copy of the original. Set Backup=true
; (or pass --b on the command line) to write a backup before the
; in-place edit. Irrelevant when ResultDir is set.
Backup=false
; BackupDir
; Used only when Backup=true and ResultDir is empty.
; - Non-empty: write a timestamped <name>.<YYYYMMDD-hhmmss>.bak
; under this folder before overwriting the source.
; - Empty (default): write <source>.BCK<N> next to the source,
; where N is the lowest unused integer (1, 2, 3, ...).
; CLI equivalent: --b <folder> (with arg) or --b (no arg, sibling).
BackupDir=
; ===================================================================
; File encoding
; ===================================================================
; Encoding
; Controls the byte-level encoding YADF uses when reading and
; writing source files.
; ANSI (default) -- single-byte ANSI, no BOM
; UTF-8-BOM -- UTF-8 with the 3-byte BOM (EF BB BF)
; UTF-16-BOM -- UTF-16 LE with the 2-byte BOM (FF FE)
;
; Existing BOM in input files is auto-detected on load regardless
; of this setting. The output's encoding is what's specified here:
; if you set UTF-8-BOM, save adds the UTF-8 BOM; if you set ANSI,
; save writes plain ANSI bytes (no BOM, even if input had one).
;
; Accepted aliases (case-insensitive):
; ANSI
; UTF-8 | UTF8 | UTF-8-BOM | UTF8BOM
; UTF-16 | UTF16 | UTF-16-BOM | UTF16BOM | UTF-16-LE
Encoding=ANSI
; ===================================================================
; Diagnostics
; ===================================================================
; Logging
; When true, YADF writes a log file `yadf-startup.log` next to the
; exe, capturing the command-line received, the resolved INI path,
; the active option values, and the per-file output decision
; (in-place / result-dir / unchanged). Also emits the same lines
; via OutputDebugString, which CodeSite Live Viewer (or
; Sysinternals DebugView) can capture in real time.
;
; Useful for diagnosing why YADF wrote where it wrote when called
; from an IDE Tool or a build script. Off by default.
; CLI: `--log` to enable, `--no-log` to disable.
Logging=false
; ===================================================================
; Pass-through rules (NOT enforced; YADF preserves what's in source)
; ===================================================================
; - Spacing around colons in declarations: after only (`X: Integer`)
; - Spacing around colons in format args: none (`X:0:2`)
; - Spacing around commas: after only
; - Spacing around semicolons: after only
; - Spaces before parens in function calls: no
; - Spacing for // line comments: after only (`// text`)
; - Spacing inside { ... } and (* ... *): inner only
; - Spacing around binary operators: before and after
; - Spacing around unary prefix operators: before and after
; - Spacing for parens / brackets / generics: tight (`(X)`, `[X]`, `Foo<T>`)