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,1034 @@
|
|
|
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::Config
|
|
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::Config";
|
|
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 (C)</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">Config</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::Config
|
|
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::Config</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/config.rb</dd>
|
|
98
|
+
</dl>
|
|
99
|
+
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
<h2>
|
|
105
|
+
Constant Summary
|
|
106
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
|
107
|
+
</h2>
|
|
108
|
+
|
|
109
|
+
<dl class="constants">
|
|
110
|
+
|
|
111
|
+
<dt id="DEFAULT_CONFIG_FILES-constant" class="">DEFAULT_CONFIG_FILES =
|
|
112
|
+
|
|
113
|
+
</dt>
|
|
114
|
+
<dd><pre class="code"><span class='qwords_beg'>%w[</span><span class='words_sep'>
|
|
115
|
+
</span><span class='words_sep'> </span><span class='tstring_content'>.yamllint</span><span class='words_sep'>
|
|
116
|
+
</span><span class='words_sep'> </span><span class='tstring_content'>.yamllint.yaml</span><span class='words_sep'>
|
|
117
|
+
</span><span class='words_sep'> </span><span class='tstring_content'>.yamllint.yml</span><span class='words_sep'>
|
|
118
|
+
</span><span class='tstring_end'>]</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
|
119
|
+
|
|
120
|
+
<dt id="YAML_FILE_PATTERNS-constant" class="">YAML_FILE_PATTERNS =
|
|
121
|
+
|
|
122
|
+
</dt>
|
|
123
|
+
<dd><pre class="code"><span class='qwords_beg'>%w[</span><span class='words_sep'>
|
|
124
|
+
</span><span class='words_sep'> </span><span class='tstring_content'>*.yaml</span><span class='words_sep'>
|
|
125
|
+
</span><span class='words_sep'> </span><span class='tstring_content'>*.yml</span><span class='words_sep'>
|
|
126
|
+
</span><span class='tstring_end'>]</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
|
127
|
+
|
|
128
|
+
</dl>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
|
135
|
+
<ul class="summary">
|
|
136
|
+
|
|
137
|
+
<li class="public ">
|
|
138
|
+
<span class="summary_signature">
|
|
139
|
+
|
|
140
|
+
<a href="#extends-instance_method" title="#extends (instance method)">#<strong>extends</strong> ⇒ Object </a>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
</span>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
<span class="note title readonly">readonly</span>
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
<span class="summary_desc"><div class='inline'>
|
|
160
|
+
<p>Returns the value of attribute extends.</p>
|
|
161
|
+
</div></span>
|
|
162
|
+
|
|
163
|
+
</li>
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
<li class="public ">
|
|
167
|
+
<span class="summary_signature">
|
|
168
|
+
|
|
169
|
+
<a href="#ignore-instance_method" title="#ignore (instance method)">#<strong>ignore</strong> ⇒ Object </a>
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
</span>
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
<span class="note title readonly">readonly</span>
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
<span class="summary_desc"><div class='inline'>
|
|
189
|
+
<p>Returns the value of attribute ignore.</p>
|
|
190
|
+
</div></span>
|
|
191
|
+
|
|
192
|
+
</li>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
<li class="public ">
|
|
196
|
+
<span class="summary_signature">
|
|
197
|
+
|
|
198
|
+
<a href="#rules-instance_method" title="#rules (instance method)">#<strong>rules</strong> ⇒ Object </a>
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
</span>
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
<span class="note title readonly">readonly</span>
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
<span class="summary_desc"><div class='inline'>
|
|
218
|
+
<p>Returns the value of attribute rules.</p>
|
|
219
|
+
</div></span>
|
|
220
|
+
|
|
221
|
+
</li>
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
<li class="public ">
|
|
225
|
+
<span class="summary_signature">
|
|
226
|
+
|
|
227
|
+
<a href="#yaml_files-instance_method" title="#yaml_files (instance method)">#<strong>yaml_files</strong> ⇒ Object </a>
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
</span>
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
<span class="note title readonly">readonly</span>
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
<span class="summary_desc"><div class='inline'>
|
|
247
|
+
<p>Returns the value of attribute yaml_files.</p>
|
|
248
|
+
</div></span>
|
|
249
|
+
|
|
250
|
+
</li>
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
</ul>
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
<h2>
|
|
260
|
+
Class Method Summary
|
|
261
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
262
|
+
</h2>
|
|
263
|
+
|
|
264
|
+
<ul class="summary">
|
|
265
|
+
|
|
266
|
+
<li class="public ">
|
|
267
|
+
<span class="summary_signature">
|
|
268
|
+
|
|
269
|
+
<a href="#build_from_hash-class_method" title="build_from_hash (class method)">.<strong>build_from_hash</strong>(data) ⇒ Object </a>
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
</span>
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
284
|
+
|
|
285
|
+
</li>
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
<li class="public ">
|
|
289
|
+
<span class="summary_signature">
|
|
290
|
+
|
|
291
|
+
<a href="#find_config_file-class_method" title="find_config_file (class method)">.<strong>find_config_file</strong> ⇒ Object </a>
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
</span>
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
306
|
+
|
|
307
|
+
</li>
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
<li class="public ">
|
|
311
|
+
<span class="summary_signature">
|
|
312
|
+
|
|
313
|
+
<a href="#load-class_method" title="load (class method)">.<strong>load</strong>(path = nil) ⇒ Object </a>
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
</span>
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
328
|
+
|
|
329
|
+
</li>
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
<li class="public ">
|
|
333
|
+
<span class="summary_signature">
|
|
334
|
+
|
|
335
|
+
<a href="#load_default-class_method" title="load_default (class method)">.<strong>load_default</strong> ⇒ Object </a>
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
</span>
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
350
|
+
|
|
351
|
+
</li>
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
<li class="public ">
|
|
355
|
+
<span class="summary_signature">
|
|
356
|
+
|
|
357
|
+
<a href="#load_from_file-class_method" title="load_from_file (class method)">.<strong>load_from_file</strong>(path) ⇒ Object </a>
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
</span>
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
372
|
+
|
|
373
|
+
</li>
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
<li class="public ">
|
|
377
|
+
<span class="summary_signature">
|
|
378
|
+
|
|
379
|
+
<a href="#new_with_preset-class_method" title="new_with_preset (class method)">.<strong>new_with_preset</strong>(preset_name) ⇒ Object </a>
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
</span>
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
394
|
+
|
|
395
|
+
</li>
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
</ul>
|
|
399
|
+
|
|
400
|
+
<h2>
|
|
401
|
+
Instance Method Summary
|
|
402
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
403
|
+
</h2>
|
|
404
|
+
|
|
405
|
+
<ul class="summary">
|
|
406
|
+
|
|
407
|
+
<li class="public ">
|
|
408
|
+
<span class="summary_signature">
|
|
409
|
+
|
|
410
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(options = {}) ⇒ Config </a>
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
</span>
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
<span class="note title constructor">constructor</span>
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
<span class="summary_desc"><div class='inline'>
|
|
427
|
+
<p>A new instance of Config.</p>
|
|
428
|
+
</div></span>
|
|
429
|
+
|
|
430
|
+
</li>
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
<li class="public ">
|
|
434
|
+
<span class="summary_signature">
|
|
435
|
+
|
|
436
|
+
<a href="#rule_config-instance_method" title="#rule_config (instance method)">#<strong>rule_config</strong>(rule_id) ⇒ Object </a>
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
</span>
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
451
|
+
|
|
452
|
+
</li>
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
<li class="public ">
|
|
456
|
+
<span class="summary_signature">
|
|
457
|
+
|
|
458
|
+
<a href="#rule_enabled%3F-instance_method" title="#rule_enabled? (instance method)">#<strong>rule_enabled?</strong>(rule_id) ⇒ Boolean </a>
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
</span>
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
473
|
+
|
|
474
|
+
</li>
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
</ul>
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
<div id="constructor_details" class="method_details_list">
|
|
481
|
+
<h2>Constructor Details</h2>
|
|
482
|
+
|
|
483
|
+
<div class="method_details first">
|
|
484
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
485
|
+
|
|
486
|
+
#<strong>initialize</strong>(options = {}) ⇒ <tt><span class='object_link'><a href="" title="Yamlint::Config (class)">Config</a></span></tt>
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
</h3><div class="docstring">
|
|
493
|
+
<div class="discussion">
|
|
494
|
+
|
|
495
|
+
<p>Returns a new instance of Config.</p>
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
</div>
|
|
499
|
+
</div>
|
|
500
|
+
<div class="tags">
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
</div><table class="source_code">
|
|
504
|
+
<tr>
|
|
505
|
+
<td>
|
|
506
|
+
<pre class="lines">
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
20
|
|
510
|
+
21
|
|
511
|
+
22
|
|
512
|
+
23
|
|
513
|
+
24
|
|
514
|
+
25</pre>
|
|
515
|
+
</td>
|
|
516
|
+
<td>
|
|
517
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/config.rb', line 20</span>
|
|
518
|
+
|
|
519
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
520
|
+
<span class='ivar'>@extends</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:extends</span><span class='rbracket'>]</span>
|
|
521
|
+
<span class='ivar'>@yaml_files</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:'yaml-files'</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>yaml-files</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'><span class='object_link'><a href="#YAML_FILE_PATTERNS-constant" title="Yamlint::Config::YAML_FILE_PATTERNS (constant)">YAML_FILE_PATTERNS</a></span></span>
|
|
522
|
+
<span class='ivar'>@ignore</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:ignore</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ignore</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
523
|
+
<span class='ivar'>@rules</span> <span class='op'>=</span> <span class='id identifier rubyid_normalize_rules'>normalize_rules</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:rules</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rules</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
524
|
+
<span class='kw'>end</span></pre>
|
|
525
|
+
</td>
|
|
526
|
+
</tr>
|
|
527
|
+
</table>
|
|
528
|
+
</div>
|
|
529
|
+
|
|
530
|
+
</div>
|
|
531
|
+
|
|
532
|
+
<div id="instance_attr_details" class="attr_details">
|
|
533
|
+
<h2>Instance Attribute Details</h2>
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
<span id=""></span>
|
|
537
|
+
<div class="method_details first">
|
|
538
|
+
<h3 class="signature first" id="extends-instance_method">
|
|
539
|
+
|
|
540
|
+
#<strong>extends</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
</h3><div class="docstring">
|
|
547
|
+
<div class="discussion">
|
|
548
|
+
|
|
549
|
+
<p>Returns the value of attribute extends.</p>
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
</div>
|
|
553
|
+
</div>
|
|
554
|
+
<div class="tags">
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
</div><table class="source_code">
|
|
558
|
+
<tr>
|
|
559
|
+
<td>
|
|
560
|
+
<pre class="lines">
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
18
|
|
564
|
+
19
|
|
565
|
+
20</pre>
|
|
566
|
+
</td>
|
|
567
|
+
<td>
|
|
568
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/config.rb', line 18</span>
|
|
569
|
+
|
|
570
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extends'>extends</span>
|
|
571
|
+
<span class='ivar'>@extends</span>
|
|
572
|
+
<span class='kw'>end</span></pre>
|
|
573
|
+
</td>
|
|
574
|
+
</tr>
|
|
575
|
+
</table>
|
|
576
|
+
</div>
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
<span id=""></span>
|
|
580
|
+
<div class="method_details ">
|
|
581
|
+
<h3 class="signature " id="ignore-instance_method">
|
|
582
|
+
|
|
583
|
+
#<strong>ignore</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
</h3><div class="docstring">
|
|
590
|
+
<div class="discussion">
|
|
591
|
+
|
|
592
|
+
<p>Returns the value of attribute ignore.</p>
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
</div>
|
|
596
|
+
</div>
|
|
597
|
+
<div class="tags">
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
</div><table class="source_code">
|
|
601
|
+
<tr>
|
|
602
|
+
<td>
|
|
603
|
+
<pre class="lines">
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
18
|
|
607
|
+
19
|
|
608
|
+
20</pre>
|
|
609
|
+
</td>
|
|
610
|
+
<td>
|
|
611
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/config.rb', line 18</span>
|
|
612
|
+
|
|
613
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ignore'>ignore</span>
|
|
614
|
+
<span class='ivar'>@ignore</span>
|
|
615
|
+
<span class='kw'>end</span></pre>
|
|
616
|
+
</td>
|
|
617
|
+
</tr>
|
|
618
|
+
</table>
|
|
619
|
+
</div>
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
<span id=""></span>
|
|
623
|
+
<div class="method_details ">
|
|
624
|
+
<h3 class="signature " id="rules-instance_method">
|
|
625
|
+
|
|
626
|
+
#<strong>rules</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
</h3><div class="docstring">
|
|
633
|
+
<div class="discussion">
|
|
634
|
+
|
|
635
|
+
<p>Returns the value of attribute rules.</p>
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
</div>
|
|
639
|
+
</div>
|
|
640
|
+
<div class="tags">
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
</div><table class="source_code">
|
|
644
|
+
<tr>
|
|
645
|
+
<td>
|
|
646
|
+
<pre class="lines">
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
18
|
|
650
|
+
19
|
|
651
|
+
20</pre>
|
|
652
|
+
</td>
|
|
653
|
+
<td>
|
|
654
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/config.rb', line 18</span>
|
|
655
|
+
|
|
656
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_rules'>rules</span>
|
|
657
|
+
<span class='ivar'>@rules</span>
|
|
658
|
+
<span class='kw'>end</span></pre>
|
|
659
|
+
</td>
|
|
660
|
+
</tr>
|
|
661
|
+
</table>
|
|
662
|
+
</div>
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
<span id=""></span>
|
|
666
|
+
<div class="method_details ">
|
|
667
|
+
<h3 class="signature " id="yaml_files-instance_method">
|
|
668
|
+
|
|
669
|
+
#<strong>yaml_files</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
</h3><div class="docstring">
|
|
676
|
+
<div class="discussion">
|
|
677
|
+
|
|
678
|
+
<p>Returns the value of attribute yaml_files.</p>
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
</div>
|
|
682
|
+
</div>
|
|
683
|
+
<div class="tags">
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
</div><table class="source_code">
|
|
687
|
+
<tr>
|
|
688
|
+
<td>
|
|
689
|
+
<pre class="lines">
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
18
|
|
693
|
+
19
|
|
694
|
+
20</pre>
|
|
695
|
+
</td>
|
|
696
|
+
<td>
|
|
697
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/config.rb', line 18</span>
|
|
698
|
+
|
|
699
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_yaml_files'>yaml_files</span>
|
|
700
|
+
<span class='ivar'>@yaml_files</span>
|
|
701
|
+
<span class='kw'>end</span></pre>
|
|
702
|
+
</td>
|
|
703
|
+
</tr>
|
|
704
|
+
</table>
|
|
705
|
+
</div>
|
|
706
|
+
|
|
707
|
+
</div>
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
<div id="class_method_details" class="method_details_list">
|
|
711
|
+
<h2>Class Method Details</h2>
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
<div class="method_details first">
|
|
715
|
+
<h3 class="signature first" id="build_from_hash-class_method">
|
|
716
|
+
|
|
717
|
+
.<strong>build_from_hash</strong>(data) ⇒ <tt>Object</tt>
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
</h3><table class="source_code">
|
|
724
|
+
<tr>
|
|
725
|
+
<td>
|
|
726
|
+
<pre class="lines">
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
59
|
|
730
|
+
60
|
|
731
|
+
61
|
|
732
|
+
62
|
|
733
|
+
63
|
|
734
|
+
64
|
|
735
|
+
65
|
|
736
|
+
66
|
|
737
|
+
67
|
|
738
|
+
68</pre>
|
|
739
|
+
</td>
|
|
740
|
+
<td>
|
|
741
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/config.rb', line 59</span>
|
|
742
|
+
|
|
743
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_build_from_hash'>build_from_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
|
744
|
+
<span class='id identifier rubyid_base_config'>base_config</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>extends</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
745
|
+
<span class='const'><span class='object_link'><a href="Presets.html" title="Yamlint::Presets (module)">Presets</a></span></span><span class='period'>.</span><span class='id identifier rubyid_get'><span class='object_link'><a href="Presets.html#get-class_method" title="Yamlint::Presets.get (method)">get</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>extends</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
746
|
+
<span class='kw'>else</span>
|
|
747
|
+
<span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
748
|
+
<span class='kw'>end</span>
|
|
749
|
+
|
|
750
|
+
<span class='id identifier rubyid_merged'>merged</span> <span class='op'>=</span> <span class='id identifier rubyid_deep_merge'>deep_merge</span><span class='lparen'>(</span><span class='id identifier rubyid_base_config'>base_config</span><span class='comma'>,</span> <span class='id identifier rubyid_symbolize_keys'>symbolize_keys</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
751
|
+
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_merged'>merged</span><span class='rparen'>)</span>
|
|
752
|
+
<span class='kw'>end</span></pre>
|
|
753
|
+
</td>
|
|
754
|
+
</tr>
|
|
755
|
+
</table>
|
|
756
|
+
</div>
|
|
757
|
+
|
|
758
|
+
<div class="method_details ">
|
|
759
|
+
<h3 class="signature " id="find_config_file-class_method">
|
|
760
|
+
|
|
761
|
+
.<strong>find_config_file</strong> ⇒ <tt>Object</tt>
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
</h3><table class="source_code">
|
|
768
|
+
<tr>
|
|
769
|
+
<td>
|
|
770
|
+
<pre class="lines">
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
50
|
|
774
|
+
51
|
|
775
|
+
52</pre>
|
|
776
|
+
</td>
|
|
777
|
+
<td>
|
|
778
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/config.rb', line 50</span>
|
|
779
|
+
|
|
780
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_find_config_file'>find_config_file</span>
|
|
781
|
+
<span class='const'><span class='object_link'><a href="#DEFAULT_CONFIG_FILES-constant" title="Yamlint::Config::DEFAULT_CONFIG_FILES (constant)">DEFAULT_CONFIG_FILES</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_f'>f</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
782
|
+
<span class='kw'>end</span></pre>
|
|
783
|
+
</td>
|
|
784
|
+
</tr>
|
|
785
|
+
</table>
|
|
786
|
+
</div>
|
|
787
|
+
|
|
788
|
+
<div class="method_details ">
|
|
789
|
+
<h3 class="signature " id="load-class_method">
|
|
790
|
+
|
|
791
|
+
.<strong>load</strong>(path = nil) ⇒ <tt>Object</tt>
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
</h3><table class="source_code">
|
|
798
|
+
<tr>
|
|
799
|
+
<td>
|
|
800
|
+
<pre class="lines">
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
27
|
|
804
|
+
28
|
|
805
|
+
29
|
|
806
|
+
30
|
|
807
|
+
31
|
|
808
|
+
32
|
|
809
|
+
33</pre>
|
|
810
|
+
</td>
|
|
811
|
+
<td>
|
|
812
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/config.rb', line 27</span>
|
|
813
|
+
|
|
814
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
815
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_path'>path</span>
|
|
816
|
+
<span class='id identifier rubyid_load_from_file'>load_from_file</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
|
817
|
+
<span class='kw'>else</span>
|
|
818
|
+
<span class='id identifier rubyid_load_default'>load_default</span>
|
|
819
|
+
<span class='kw'>end</span>
|
|
820
|
+
<span class='kw'>end</span></pre>
|
|
821
|
+
</td>
|
|
822
|
+
</tr>
|
|
823
|
+
</table>
|
|
824
|
+
</div>
|
|
825
|
+
|
|
826
|
+
<div class="method_details ">
|
|
827
|
+
<h3 class="signature " id="load_default-class_method">
|
|
828
|
+
|
|
829
|
+
.<strong>load_default</strong> ⇒ <tt>Object</tt>
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
</h3><table class="source_code">
|
|
836
|
+
<tr>
|
|
837
|
+
<td>
|
|
838
|
+
<pre class="lines">
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
41
|
|
842
|
+
42
|
|
843
|
+
43
|
|
844
|
+
44
|
|
845
|
+
45
|
|
846
|
+
46
|
|
847
|
+
47
|
|
848
|
+
48</pre>
|
|
849
|
+
</td>
|
|
850
|
+
<td>
|
|
851
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/config.rb', line 41</span>
|
|
852
|
+
|
|
853
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_default'>load_default</span>
|
|
854
|
+
<span class='id identifier rubyid_config_file'>config_file</span> <span class='op'>=</span> <span class='id identifier rubyid_find_config_file'>find_config_file</span>
|
|
855
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_config_file'>config_file</span>
|
|
856
|
+
<span class='id identifier rubyid_load_from_file'>load_from_file</span><span class='lparen'>(</span><span class='id identifier rubyid_config_file'>config_file</span><span class='rparen'>)</span>
|
|
857
|
+
<span class='kw'>else</span>
|
|
858
|
+
<span class='id identifier rubyid_new_with_preset'>new_with_preset</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>default</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
859
|
+
<span class='kw'>end</span>
|
|
860
|
+
<span class='kw'>end</span></pre>
|
|
861
|
+
</td>
|
|
862
|
+
</tr>
|
|
863
|
+
</table>
|
|
864
|
+
</div>
|
|
865
|
+
|
|
866
|
+
<div class="method_details ">
|
|
867
|
+
<h3 class="signature " id="load_from_file-class_method">
|
|
868
|
+
|
|
869
|
+
.<strong>load_from_file</strong>(path) ⇒ <tt>Object</tt>
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
</h3><table class="source_code">
|
|
876
|
+
<tr>
|
|
877
|
+
<td>
|
|
878
|
+
<pre class="lines">
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
35
|
|
882
|
+
36
|
|
883
|
+
37
|
|
884
|
+
38
|
|
885
|
+
39</pre>
|
|
886
|
+
</td>
|
|
887
|
+
<td>
|
|
888
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/config.rb', line 35</span>
|
|
889
|
+
|
|
890
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_from_file'>load_from_file</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
|
891
|
+
<span class='id identifier rubyid_content'>content</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_path'>path</span><span class='rparen'>)</span>
|
|
892
|
+
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='const'>YAML</span><span class='period'>.</span><span class='id identifier rubyid_safe_load'>safe_load</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='label'>permitted_classes:</span> <span class='lbracket'>[</span><span class='const'>Symbol</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
893
|
+
<span class='id identifier rubyid_build_from_hash'>build_from_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
|
894
|
+
<span class='kw'>end</span></pre>
|
|
895
|
+
</td>
|
|
896
|
+
</tr>
|
|
897
|
+
</table>
|
|
898
|
+
</div>
|
|
899
|
+
|
|
900
|
+
<div class="method_details ">
|
|
901
|
+
<h3 class="signature " id="new_with_preset-class_method">
|
|
902
|
+
|
|
903
|
+
.<strong>new_with_preset</strong>(preset_name) ⇒ <tt>Object</tt>
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
</h3><table class="source_code">
|
|
910
|
+
<tr>
|
|
911
|
+
<td>
|
|
912
|
+
<pre class="lines">
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
54
|
|
916
|
+
55
|
|
917
|
+
56
|
|
918
|
+
57</pre>
|
|
919
|
+
</td>
|
|
920
|
+
<td>
|
|
921
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/config.rb', line 54</span>
|
|
922
|
+
|
|
923
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new_with_preset'>new_with_preset</span><span class='lparen'>(</span><span class='id identifier rubyid_preset_name'>preset_name</span><span class='rparen'>)</span>
|
|
924
|
+
<span class='id identifier rubyid_preset'>preset</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Presets.html" title="Yamlint::Presets (module)">Presets</a></span></span><span class='period'>.</span><span class='id identifier rubyid_get'><span class='object_link'><a href="Presets.html#get-class_method" title="Yamlint::Presets.get (method)">get</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_preset_name'>preset_name</span><span class='rparen'>)</span>
|
|
925
|
+
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_preset'>preset</span><span class='rparen'>)</span>
|
|
926
|
+
<span class='kw'>end</span></pre>
|
|
927
|
+
</td>
|
|
928
|
+
</tr>
|
|
929
|
+
</table>
|
|
930
|
+
</div>
|
|
931
|
+
|
|
932
|
+
</div>
|
|
933
|
+
|
|
934
|
+
<div id="instance_method_details" class="method_details_list">
|
|
935
|
+
<h2>Instance Method Details</h2>
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
<div class="method_details first">
|
|
939
|
+
<h3 class="signature first" id="rule_config-instance_method">
|
|
940
|
+
|
|
941
|
+
#<strong>rule_config</strong>(rule_id) ⇒ <tt>Object</tt>
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
</h3><table class="source_code">
|
|
948
|
+
<tr>
|
|
949
|
+
<td>
|
|
950
|
+
<pre class="lines">
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
70
|
|
954
|
+
71
|
|
955
|
+
72</pre>
|
|
956
|
+
</td>
|
|
957
|
+
<td>
|
|
958
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/config.rb', line 70</span>
|
|
959
|
+
|
|
960
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_rule_config'>rule_config</span><span class='lparen'>(</span><span class='id identifier rubyid_rule_id'>rule_id</span><span class='rparen'>)</span>
|
|
961
|
+
<span class='ivar'>@rules</span><span class='lbracket'>[</span><span class='id identifier rubyid_rule_id'>rule_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='ivar'>@rules</span><span class='lbracket'>[</span><span class='id identifier rubyid_rule_id'>rule_id</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
962
|
+
<span class='kw'>end</span></pre>
|
|
963
|
+
</td>
|
|
964
|
+
</tr>
|
|
965
|
+
</table>
|
|
966
|
+
</div>
|
|
967
|
+
|
|
968
|
+
<div class="method_details ">
|
|
969
|
+
<h3 class="signature " id="rule_enabled?-instance_method">
|
|
970
|
+
|
|
971
|
+
#<strong>rule_enabled?</strong>(rule_id) ⇒ <tt>Boolean</tt>
|
|
972
|
+
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
|
|
976
|
+
|
|
977
|
+
</h3><div class="docstring">
|
|
978
|
+
<div class="discussion">
|
|
979
|
+
|
|
980
|
+
|
|
981
|
+
</div>
|
|
982
|
+
</div>
|
|
983
|
+
<div class="tags">
|
|
984
|
+
|
|
985
|
+
<p class="tag_title">Returns:</p>
|
|
986
|
+
<ul class="return">
|
|
987
|
+
|
|
988
|
+
<li>
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
</li>
|
|
996
|
+
|
|
997
|
+
</ul>
|
|
998
|
+
|
|
999
|
+
</div><table class="source_code">
|
|
1000
|
+
<tr>
|
|
1001
|
+
<td>
|
|
1002
|
+
<pre class="lines">
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
74
|
|
1006
|
+
75
|
|
1007
|
+
76
|
|
1008
|
+
77</pre>
|
|
1009
|
+
</td>
|
|
1010
|
+
<td>
|
|
1011
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/config.rb', line 74</span>
|
|
1012
|
+
|
|
1013
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_rule_enabled?'>rule_enabled?</span><span class='lparen'>(</span><span class='id identifier rubyid_rule_id'>rule_id</span><span class='rparen'>)</span>
|
|
1014
|
+
<span class='id identifier rubyid_config'>config</span> <span class='op'>=</span> <span class='id identifier rubyid_rule_config'>rule_config</span><span class='lparen'>(</span><span class='id identifier rubyid_rule_id'>rule_id</span><span class='rparen'>)</span>
|
|
1015
|
+
<span class='id identifier rubyid_config'>config</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>disable</span><span class='tstring_end'>'</span></span> <span class='op'>&&</span> <span class='id identifier rubyid_config'>config</span> <span class='op'>!=</span> <span class='kw'>false</span>
|
|
1016
|
+
<span class='kw'>end</span></pre>
|
|
1017
|
+
</td>
|
|
1018
|
+
</tr>
|
|
1019
|
+
</table>
|
|
1020
|
+
</div>
|
|
1021
|
+
|
|
1022
|
+
</div>
|
|
1023
|
+
|
|
1024
|
+
</div>
|
|
1025
|
+
|
|
1026
|
+
<div id="footer">
|
|
1027
|
+
Generated on Sun Jan 25 08:00:08 2026 by
|
|
1028
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1029
|
+
0.9.38 (ruby-4.0.0).
|
|
1030
|
+
</div>
|
|
1031
|
+
|
|
1032
|
+
</div>
|
|
1033
|
+
</body>
|
|
1034
|
+
</html>
|