yamlint 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +31 -9
- data/.serena/.gitignore +1 -0
- data/.serena/memories/project_overview.md +25 -0
- data/.serena/memories/style_and_conventions.md +7 -0
- data/.serena/memories/suggested_commands.md +17 -0
- data/.serena/memories/task_completion.md +5 -0
- data/.serena/project.yml +89 -0
- data/CHANGELOG.md +6 -2
- data/Gemfile +9 -7
- data/LICENSE.txt +1 -1
- data/README.md +155 -17
- data/Rakefile +10 -3
- data/docs/Yamlint/Cli.html +403 -0
- data/docs/Yamlint/Config.html +1034 -0
- data/docs/Yamlint/Formatter.html +433 -0
- data/docs/Yamlint/Linter.html +423 -0
- data/docs/Yamlint/Models/LintContext.html +993 -0
- data/docs/Yamlint/Models/Problem.html +951 -0
- data/docs/Yamlint/Models/Token.html +713 -0
- data/docs/Yamlint/Models.html +117 -0
- data/docs/Yamlint/Output/Base.html +290 -0
- data/docs/Yamlint/Output/Colored.html +293 -0
- data/docs/Yamlint/Output/Github.html +260 -0
- data/docs/Yamlint/Output/Parsable.html +258 -0
- data/docs/Yamlint/Output/Standard.html +270 -0
- data/docs/Yamlint/Output.html +208 -0
- data/docs/Yamlint/Parser/Comment.html +795 -0
- data/docs/Yamlint/Parser/CommentExtractor.html +287 -0
- data/docs/Yamlint/Parser/LineParser.html +423 -0
- data/docs/Yamlint/Parser/TokenParser/Handler.html +910 -0
- data/docs/Yamlint/Parser/TokenParser.html +291 -0
- data/docs/Yamlint/Parser.html +117 -0
- data/docs/Yamlint/Presets.html +266 -0
- data/docs/Yamlint/Rules/Anchors/AnchorHandler.html +678 -0
- data/docs/Yamlint/Rules/Anchors.html +314 -0
- data/docs/Yamlint/Rules/Base.html +968 -0
- data/docs/Yamlint/Rules/Braces.html +335 -0
- data/docs/Yamlint/Rules/Brackets.html +335 -0
- data/docs/Yamlint/Rules/Colons.html +313 -0
- data/docs/Yamlint/Rules/Commas.html +313 -0
- data/docs/Yamlint/Rules/CommentRule.html +298 -0
- data/docs/Yamlint/Rules/Comments.html +317 -0
- data/docs/Yamlint/Rules/CommentsIndentation.html +328 -0
- data/docs/Yamlint/Rules/DocumentEnd.html +332 -0
- data/docs/Yamlint/Rules/DocumentStart.html +332 -0
- data/docs/Yamlint/Rules/EmptyLines.html +300 -0
- data/docs/Yamlint/Rules/EmptyValues.html +273 -0
- data/docs/Yamlint/Rules/FloatValues.html +383 -0
- data/docs/Yamlint/Rules/Hyphens.html +337 -0
- data/docs/Yamlint/Rules/Indentation.html +329 -0
- data/docs/Yamlint/Rules/KeyDuplicates/DuplicateKeyHandler.html +716 -0
- data/docs/Yamlint/Rules/KeyDuplicates.html +258 -0
- data/docs/Yamlint/Rules/KeyOrdering/KeyOrderHandler.html +694 -0
- data/docs/Yamlint/Rules/KeyOrdering.html +258 -0
- data/docs/Yamlint/Rules/LineLength.html +251 -0
- data/docs/Yamlint/Rules/LineRule.html +304 -0
- data/docs/Yamlint/Rules/NewLineAtEndOfFile.html +308 -0
- data/docs/Yamlint/Rules/NewLines.html +310 -0
- data/docs/Yamlint/Rules/OctalValues.html +270 -0
- data/docs/Yamlint/Rules/QuotedStrings.html +381 -0
- data/docs/Yamlint/Rules/Registry.html +492 -0
- data/docs/Yamlint/Rules/TokenRule.html +298 -0
- data/docs/Yamlint/Rules/TrailingSpaces.html +321 -0
- data/docs/Yamlint/Rules/Truthy.html +288 -0
- data/docs/Yamlint/Rules.html +190 -0
- data/docs/Yamlint/Runner.html +551 -0
- data/docs/Yamlint.html +135 -0
- data/docs/_index.html +643 -0
- data/docs/class_list.html +54 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +490 -0
- data/docs/file.README.html +276 -0
- data/docs/file_list.html +59 -0
- data/docs/frames.html +22 -0
- data/docs/index.html +276 -0
- data/docs/js/app.js +395 -0
- data/docs/js/full_list.js +244 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +1582 -0
- data/docs/top-level-namespace.html +110 -0
- data/exe/yamlint +7 -0
- data/lib/yamlint/cli.rb +162 -0
- data/lib/yamlint/config.rb +113 -0
- data/lib/yamlint/formatter.rb +140 -0
- data/lib/yamlint/linter.rb +130 -0
- data/lib/yamlint/models/lint_context.rb +43 -0
- data/lib/yamlint/models/problem.rb +44 -0
- data/lib/yamlint/models/token.rb +22 -0
- data/lib/yamlint/models.rb +9 -0
- data/lib/yamlint/output/base.rb +15 -0
- data/lib/yamlint/output/colored.rb +54 -0
- data/lib/yamlint/output/github.rb +20 -0
- data/lib/yamlint/output/parsable.rb +19 -0
- data/lib/yamlint/output/standard.rb +25 -0
- data/lib/yamlint/output.rb +26 -0
- data/lib/yamlint/parser/comment_extractor.rb +78 -0
- data/lib/yamlint/parser/line_parser.rb +30 -0
- data/lib/yamlint/parser/token_parser.rb +92 -0
- data/lib/yamlint/parser.rb +10 -0
- data/lib/yamlint/presets/default.rb +35 -0
- data/lib/yamlint/presets/relaxed.rb +34 -0
- data/lib/yamlint/presets.rb +19 -0
- data/lib/yamlint/rules/anchors.rb +133 -0
- data/lib/yamlint/rules/base.rb +102 -0
- data/lib/yamlint/rules/braces.rb +105 -0
- data/lib/yamlint/rules/brackets.rb +105 -0
- data/lib/yamlint/rules/colons.rb +73 -0
- data/lib/yamlint/rules/commas.rb +85 -0
- data/lib/yamlint/rules/comments.rb +77 -0
- data/lib/yamlint/rules/comments_indentation.rb +66 -0
- data/lib/yamlint/rules/document_end.rb +45 -0
- data/lib/yamlint/rules/document_start.rb +45 -0
- data/lib/yamlint/rules/empty_lines.rb +107 -0
- data/lib/yamlint/rules/empty_values.rb +43 -0
- data/lib/yamlint/rules/float_values.rb +67 -0
- data/lib/yamlint/rules/hyphens.rb +42 -0
- data/lib/yamlint/rules/indentation.rb +39 -0
- data/lib/yamlint/rules/key_duplicates.rb +127 -0
- data/lib/yamlint/rules/key_ordering.rb +126 -0
- data/lib/yamlint/rules/line_length.rb +57 -0
- data/lib/yamlint/rules/new_line_at_end_of_file.rb +31 -0
- data/lib/yamlint/rules/new_lines.rb +59 -0
- data/lib/yamlint/rules/octal_values.rb +62 -0
- data/lib/yamlint/rules/quoted_strings.rb +73 -0
- data/lib/yamlint/rules/registry.rb +48 -0
- data/lib/yamlint/rules/trailing_spaces.rb +31 -0
- data/lib/yamlint/rules/truthy.rb +48 -0
- data/lib/yamlint/rules.rb +41 -0
- data/lib/yamlint/runner.rb +80 -0
- data/lib/yamlint/version.rb +1 -1
- data/lib/yamlint.rb +11 -3
- metadata +131 -11
- data/CODE_OF_CONDUCT.md +0 -84
- data/sig/yamlint.rbs +0 -4
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>
|
|
7
|
+
Class: Yamlint::Runner
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.9.38
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript">
|
|
18
|
+
pathId = "Yamlint::Runner";
|
|
19
|
+
relpath = '../';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
24
|
+
|
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<div class="nav_wrap">
|
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
|
32
|
+
<div id="resizer"></div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="main" tabindex="-1">
|
|
36
|
+
<div id="header">
|
|
37
|
+
<div id="menu">
|
|
38
|
+
|
|
39
|
+
<a href="../_index.html">Index (R)</a> »
|
|
40
|
+
<span class='title'><span class='object_link'><a href="../Yamlint.html" title="Yamlint (module)">Yamlint</a></span></span>
|
|
41
|
+
»
|
|
42
|
+
<span class="title">Runner</span>
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div id="search">
|
|
47
|
+
|
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
|
49
|
+
href="../class_list.html">
|
|
50
|
+
|
|
51
|
+
<svg width="24" height="24">
|
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
</svg>
|
|
56
|
+
</a>
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
<div class="clear"></div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div id="content"><h1>Class: Yamlint::Runner
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
<dl>
|
|
70
|
+
<dt>Inherits:</dt>
|
|
71
|
+
<dd>
|
|
72
|
+
<span class="inheritName">Object</span>
|
|
73
|
+
|
|
74
|
+
<ul class="fullTree">
|
|
75
|
+
<li>Object</li>
|
|
76
|
+
|
|
77
|
+
<li class="next">Yamlint::Runner</li>
|
|
78
|
+
|
|
79
|
+
</ul>
|
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
81
|
+
|
|
82
|
+
</dd>
|
|
83
|
+
</dl>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
<dl>
|
|
96
|
+
<dt>Defined in:</dt>
|
|
97
|
+
<dd>lib/yamlint/runner.rb</dd>
|
|
98
|
+
</dl>
|
|
99
|
+
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
|
107
|
+
<ul class="summary">
|
|
108
|
+
|
|
109
|
+
<li class="public ">
|
|
110
|
+
<span class="summary_signature">
|
|
111
|
+
|
|
112
|
+
<a href="#config-instance_method" title="#config (instance method)">#<strong>config</strong> ⇒ Object </a>
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
</span>
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
<span class="note title readonly">readonly</span>
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
<span class="summary_desc"><div class='inline'>
|
|
132
|
+
<p>Returns the value of attribute config.</p>
|
|
133
|
+
</div></span>
|
|
134
|
+
|
|
135
|
+
</li>
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
<li class="public ">
|
|
139
|
+
<span class="summary_signature">
|
|
140
|
+
|
|
141
|
+
<a href="#output_format-instance_method" title="#output_format (instance method)">#<strong>output_format</strong> ⇒ Object </a>
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
</span>
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
<span class="note title readonly">readonly</span>
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
<span class="summary_desc"><div class='inline'>
|
|
161
|
+
<p>Returns the value of attribute output_format.</p>
|
|
162
|
+
</div></span>
|
|
163
|
+
|
|
164
|
+
</li>
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
</ul>
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
<h2>
|
|
174
|
+
Instance Method Summary
|
|
175
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
176
|
+
</h2>
|
|
177
|
+
|
|
178
|
+
<ul class="summary">
|
|
179
|
+
|
|
180
|
+
<li class="public ">
|
|
181
|
+
<span class="summary_signature">
|
|
182
|
+
|
|
183
|
+
<a href="#format-instance_method" title="#format (instance method)">#<strong>format</strong>(paths, dry_run: false) ⇒ Object </a>
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
</span>
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
198
|
+
|
|
199
|
+
</li>
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
<li class="public ">
|
|
203
|
+
<span class="summary_signature">
|
|
204
|
+
|
|
205
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(config: nil, output_format: 'colored') ⇒ Runner </a>
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
</span>
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
<span class="note title constructor">constructor</span>
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
<span class="summary_desc"><div class='inline'>
|
|
222
|
+
<p>A new instance of Runner.</p>
|
|
223
|
+
</div></span>
|
|
224
|
+
|
|
225
|
+
</li>
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
<li class="public ">
|
|
229
|
+
<span class="summary_signature">
|
|
230
|
+
|
|
231
|
+
<a href="#lint-instance_method" title="#lint (instance method)">#<strong>lint</strong>(paths) ⇒ Object </a>
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
</span>
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
246
|
+
|
|
247
|
+
</li>
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
</ul>
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
<div id="constructor_details" class="method_details_list">
|
|
254
|
+
<h2>Constructor Details</h2>
|
|
255
|
+
|
|
256
|
+
<div class="method_details first">
|
|
257
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
258
|
+
|
|
259
|
+
#<strong>initialize</strong>(config: nil, output_format: 'colored') ⇒ <tt><span class='object_link'><a href="" title="Yamlint::Runner (class)">Runner</a></span></tt>
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
</h3><div class="docstring">
|
|
266
|
+
<div class="discussion">
|
|
267
|
+
|
|
268
|
+
<p>Returns a new instance of Runner.</p>
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
<div class="tags">
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
</div><table class="source_code">
|
|
277
|
+
<tr>
|
|
278
|
+
<td>
|
|
279
|
+
<pre class="lines">
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
7
|
|
283
|
+
8
|
|
284
|
+
9
|
|
285
|
+
10
|
|
286
|
+
11
|
|
287
|
+
12
|
|
288
|
+
13</pre>
|
|
289
|
+
</td>
|
|
290
|
+
<td>
|
|
291
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/runner.rb', line 7</span>
|
|
292
|
+
|
|
293
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>config:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>output_format:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>colored</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
294
|
+
<span class='ivar'>@config</span> <span class='op'>=</span> <span class='id identifier rubyid_config'>config</span> <span class='op'>||</span> <span class='const'><span class='object_link'><a href="Config.html" title="Yamlint::Config (class)">Config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_load_default'><span class='object_link'><a href="Config.html#load_default-class_method" title="Yamlint::Config.load_default (method)">load_default</a></span></span>
|
|
295
|
+
<span class='ivar'>@output_format</span> <span class='op'>=</span> <span class='id identifier rubyid_output_format'>output_format</span>
|
|
296
|
+
<span class='ivar'>@linter</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Linter.html" title="Yamlint::Linter (class)">Linter</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Linter.html#initialize-instance_method" title="Yamlint::Linter#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@config</span><span class='rparen'>)</span>
|
|
297
|
+
<span class='ivar'>@formatter</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Formatter.html" title="Yamlint::Formatter (class)">Formatter</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Formatter.html#initialize-instance_method" title="Yamlint::Formatter#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@config</span><span class='rparen'>)</span>
|
|
298
|
+
<span class='ivar'>@output</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Output.html" title="Yamlint::Output (module)">Output</a></span></span><span class='period'>.</span><span class='id identifier rubyid_get'><span class='object_link'><a href="Output.html#get-class_method" title="Yamlint::Output.get (method)">get</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_output_format'>output_format</span><span class='rparen'>)</span>
|
|
299
|
+
<span class='kw'>end</span></pre>
|
|
300
|
+
</td>
|
|
301
|
+
</tr>
|
|
302
|
+
</table>
|
|
303
|
+
</div>
|
|
304
|
+
|
|
305
|
+
</div>
|
|
306
|
+
|
|
307
|
+
<div id="instance_attr_details" class="attr_details">
|
|
308
|
+
<h2>Instance Attribute Details</h2>
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
<span id=""></span>
|
|
312
|
+
<div class="method_details first">
|
|
313
|
+
<h3 class="signature first" id="config-instance_method">
|
|
314
|
+
|
|
315
|
+
#<strong>config</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
</h3><div class="docstring">
|
|
322
|
+
<div class="discussion">
|
|
323
|
+
|
|
324
|
+
<p>Returns the value of attribute config.</p>
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
</div>
|
|
328
|
+
</div>
|
|
329
|
+
<div class="tags">
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
</div><table class="source_code">
|
|
333
|
+
<tr>
|
|
334
|
+
<td>
|
|
335
|
+
<pre class="lines">
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
5
|
|
339
|
+
6
|
|
340
|
+
7</pre>
|
|
341
|
+
</td>
|
|
342
|
+
<td>
|
|
343
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/runner.rb', line 5</span>
|
|
344
|
+
|
|
345
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_config'>config</span>
|
|
346
|
+
<span class='ivar'>@config</span>
|
|
347
|
+
<span class='kw'>end</span></pre>
|
|
348
|
+
</td>
|
|
349
|
+
</tr>
|
|
350
|
+
</table>
|
|
351
|
+
</div>
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
<span id=""></span>
|
|
355
|
+
<div class="method_details ">
|
|
356
|
+
<h3 class="signature " id="output_format-instance_method">
|
|
357
|
+
|
|
358
|
+
#<strong>output_format</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
</h3><div class="docstring">
|
|
365
|
+
<div class="discussion">
|
|
366
|
+
|
|
367
|
+
<p>Returns the value of attribute output_format.</p>
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
<div class="tags">
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
</div><table class="source_code">
|
|
376
|
+
<tr>
|
|
377
|
+
<td>
|
|
378
|
+
<pre class="lines">
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
5
|
|
382
|
+
6
|
|
383
|
+
7</pre>
|
|
384
|
+
</td>
|
|
385
|
+
<td>
|
|
386
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/runner.rb', line 5</span>
|
|
387
|
+
|
|
388
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_output_format'>output_format</span>
|
|
389
|
+
<span class='ivar'>@output_format</span>
|
|
390
|
+
<span class='kw'>end</span></pre>
|
|
391
|
+
</td>
|
|
392
|
+
</tr>
|
|
393
|
+
</table>
|
|
394
|
+
</div>
|
|
395
|
+
|
|
396
|
+
</div>
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
<div id="instance_method_details" class="method_details_list">
|
|
400
|
+
<h2>Instance Method Details</h2>
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
<div class="method_details first">
|
|
404
|
+
<h3 class="signature first" id="format-instance_method">
|
|
405
|
+
|
|
406
|
+
#<strong>format</strong>(paths, dry_run: false) ⇒ <tt>Object</tt>
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
</h3><table class="source_code">
|
|
413
|
+
<tr>
|
|
414
|
+
<td>
|
|
415
|
+
<pre class="lines">
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
39
|
|
419
|
+
40
|
|
420
|
+
41
|
|
421
|
+
42
|
|
422
|
+
43
|
|
423
|
+
44
|
|
424
|
+
45
|
|
425
|
+
46
|
|
426
|
+
47
|
|
427
|
+
48
|
|
428
|
+
49
|
|
429
|
+
50
|
|
430
|
+
51
|
|
431
|
+
52
|
|
432
|
+
53
|
|
433
|
+
54
|
|
434
|
+
55
|
|
435
|
+
56
|
|
436
|
+
57
|
|
437
|
+
58
|
|
438
|
+
59</pre>
|
|
439
|
+
</td>
|
|
440
|
+
<td>
|
|
441
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/runner.rb', line 39</span>
|
|
442
|
+
|
|
443
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='id identifier rubyid_paths'>paths</span><span class='comma'>,</span> <span class='label'>dry_run:</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
|
444
|
+
<span class='id identifier rubyid_files'>files</span> <span class='op'>=</span> <span class='id identifier rubyid_collect_files'>collect_files</span><span class='lparen'>(</span><span class='id identifier rubyid_paths'>paths</span><span class='rparen'>)</span>
|
|
445
|
+
<span class='id identifier rubyid_changed_files'>changed_files</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
446
|
+
|
|
447
|
+
<span class='id identifier rubyid_files'>files</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_filepath'>filepath</span><span class='op'>|</span>
|
|
448
|
+
<span class='id identifier rubyid_original'>original</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_filepath'>filepath</span><span class='rparen'>)</span>
|
|
449
|
+
<span class='id identifier rubyid_formatted'>formatted</span> <span class='op'>=</span> <span class='ivar'>@formatter</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='id identifier rubyid_original'>original</span><span class='comma'>,</span> <span class='label'>dry_run:</span><span class='rparen'>)</span>
|
|
450
|
+
|
|
451
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_original'>original</span> <span class='op'>!=</span> <span class='id identifier rubyid_formatted'>formatted</span>
|
|
452
|
+
<span class='id identifier rubyid_changed_files'>changed_files</span> <span class='op'><<</span> <span class='id identifier rubyid_filepath'>filepath</span>
|
|
453
|
+
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='id identifier rubyid_formatted'>formatted</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_dry_run'>dry_run</span>
|
|
454
|
+
<span class='kw'>end</span>
|
|
455
|
+
<span class='kw'>end</span>
|
|
456
|
+
|
|
457
|
+
<span class='lbrace'>{</span>
|
|
458
|
+
<span class='label'>files:</span> <span class='id identifier rubyid_files'>files</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='comma'>,</span>
|
|
459
|
+
<span class='label'>changed:</span> <span class='id identifier rubyid_changed_files'>changed_files</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='comma'>,</span>
|
|
460
|
+
<span class='label'>changed_files:</span><span class='comma'>,</span>
|
|
461
|
+
<span class='label'>exit_code:</span> <span class='int'>0</span>
|
|
462
|
+
<span class='rbrace'>}</span>
|
|
463
|
+
<span class='kw'>end</span></pre>
|
|
464
|
+
</td>
|
|
465
|
+
</tr>
|
|
466
|
+
</table>
|
|
467
|
+
</div>
|
|
468
|
+
|
|
469
|
+
<div class="method_details ">
|
|
470
|
+
<h3 class="signature " id="lint-instance_method">
|
|
471
|
+
|
|
472
|
+
#<strong>lint</strong>(paths) ⇒ <tt>Object</tt>
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
</h3><table class="source_code">
|
|
479
|
+
<tr>
|
|
480
|
+
<td>
|
|
481
|
+
<pre class="lines">
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
15
|
|
485
|
+
16
|
|
486
|
+
17
|
|
487
|
+
18
|
|
488
|
+
19
|
|
489
|
+
20
|
|
490
|
+
21
|
|
491
|
+
22
|
|
492
|
+
23
|
|
493
|
+
24
|
|
494
|
+
25
|
|
495
|
+
26
|
|
496
|
+
27
|
|
497
|
+
28
|
|
498
|
+
29
|
|
499
|
+
30
|
|
500
|
+
31
|
|
501
|
+
32
|
|
502
|
+
33
|
|
503
|
+
34
|
|
504
|
+
35
|
|
505
|
+
36
|
|
506
|
+
37</pre>
|
|
507
|
+
</td>
|
|
508
|
+
<td>
|
|
509
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/runner.rb', line 15</span>
|
|
510
|
+
|
|
511
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_lint'>lint</span><span class='lparen'>(</span><span class='id identifier rubyid_paths'>paths</span><span class='rparen'>)</span>
|
|
512
|
+
<span class='id identifier rubyid_files'>files</span> <span class='op'>=</span> <span class='id identifier rubyid_collect_files'>collect_files</span><span class='lparen'>(</span><span class='id identifier rubyid_paths'>paths</span><span class='rparen'>)</span>
|
|
513
|
+
<span class='id identifier rubyid_total_problems'>total_problems</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
514
|
+
<span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
515
|
+
|
|
516
|
+
<span class='id identifier rubyid_files'>files</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_filepath'>filepath</span><span class='op'>|</span>
|
|
517
|
+
<span class='id identifier rubyid_problems'>problems</span> <span class='op'>=</span> <span class='ivar'>@linter</span><span class='period'>.</span><span class='id identifier rubyid_lint_file'>lint_file</span><span class='lparen'>(</span><span class='id identifier rubyid_filepath'>filepath</span><span class='rparen'>)</span>
|
|
518
|
+
<span class='id identifier rubyid_total_problems'>total_problems</span> <span class='op'>+=</span> <span class='id identifier rubyid_problems'>problems</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
|
|
519
|
+
|
|
520
|
+
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='ivar'>@output</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='id identifier rubyid_problems'>problems</span><span class='rparen'>)</span>
|
|
521
|
+
<span class='id identifier rubyid_results'>results</span> <span class='op'><<</span> <span class='id identifier rubyid_output'>output</span> <span class='kw'>unless</span> <span class='id identifier rubyid_output'>output</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
|
522
|
+
<span class='kw'>end</span>
|
|
523
|
+
|
|
524
|
+
<span class='id identifier rubyid_summary'>summary</span> <span class='op'>=</span> <span class='ivar'>@output</span><span class='period'>.</span><span class='id identifier rubyid_format_summary'>format_summary</span><span class='lparen'>(</span><span class='id identifier rubyid_files'>files</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='comma'>,</span> <span class='id identifier rubyid_total_problems'>total_problems</span><span class='rparen'>)</span>
|
|
525
|
+
|
|
526
|
+
<span class='lbrace'>{</span>
|
|
527
|
+
<span class='label'>files:</span> <span class='id identifier rubyid_files'>files</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='comma'>,</span>
|
|
528
|
+
<span class='label'>problems:</span> <span class='id identifier rubyid_total_problems'>total_problems</span><span class='comma'>,</span>
|
|
529
|
+
<span class='label'>output:</span> <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='comma'>,</span>
|
|
530
|
+
<span class='label'>summary:</span><span class='comma'>,</span>
|
|
531
|
+
<span class='label'>exit_code:</span> <span class='id identifier rubyid_total_problems'>total_problems</span><span class='period'>.</span><span class='id identifier rubyid_positive?'>positive?</span> <span class='op'>?</span> <span class='int'>1</span> <span class='op'>:</span> <span class='int'>0</span>
|
|
532
|
+
<span class='rbrace'>}</span>
|
|
533
|
+
<span class='kw'>end</span></pre>
|
|
534
|
+
</td>
|
|
535
|
+
</tr>
|
|
536
|
+
</table>
|
|
537
|
+
</div>
|
|
538
|
+
|
|
539
|
+
</div>
|
|
540
|
+
|
|
541
|
+
</div>
|
|
542
|
+
|
|
543
|
+
<div id="footer">
|
|
544
|
+
Generated on Sun Jan 25 08:00:08 2026 by
|
|
545
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
546
|
+
0.9.38 (ruby-4.0.0).
|
|
547
|
+
</div>
|
|
548
|
+
|
|
549
|
+
</div>
|
|
550
|
+
</body>
|
|
551
|
+
</html>
|