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,258 @@
|
|
|
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::Rules::KeyOrdering
|
|
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::Rules::KeyOrdering";
|
|
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 (K)</a> »
|
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Yamlint.html" title="Yamlint (module)">Yamlint</a></span></span> » <span class='title'><span class='object_link'><a href="../Rules.html" title="Yamlint::Rules (module)">Rules</a></span></span>
|
|
41
|
+
»
|
|
42
|
+
<span class="title">KeyOrdering</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::Rules::KeyOrdering
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
<dl>
|
|
70
|
+
<dt>Inherits:</dt>
|
|
71
|
+
<dd>
|
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="Base.html" title="Yamlint::Rules::Base (class)">Base</a></span></span>
|
|
73
|
+
|
|
74
|
+
<ul class="fullTree">
|
|
75
|
+
<li>Object</li>
|
|
76
|
+
|
|
77
|
+
<li class="next"><span class='object_link'><a href="Base.html" title="Yamlint::Rules::Base (class)">Base</a></span></li>
|
|
78
|
+
|
|
79
|
+
<li class="next">Yamlint::Rules::KeyOrdering</li>
|
|
80
|
+
|
|
81
|
+
</ul>
|
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
83
|
+
|
|
84
|
+
</dd>
|
|
85
|
+
</dl>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
<dl>
|
|
98
|
+
<dt>Defined in:</dt>
|
|
99
|
+
<dd>lib/yamlint/rules/key_ordering.rb</dd>
|
|
100
|
+
</dl>
|
|
101
|
+
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<h2>Defined Under Namespace</h2>
|
|
105
|
+
<p class="children">
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="KeyOrdering/KeyOrderHandler.html" title="Yamlint::Rules::KeyOrdering::KeyOrderHandler (class)">KeyOrderHandler</a></span>
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
</p>
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
<h2>Instance Attribute Summary</h2>
|
|
121
|
+
|
|
122
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="Yamlint::Rules::Base (class)">Base</a></span></h3>
|
|
123
|
+
<p class="inherited"><span class='object_link'><a href="Base.html#config-instance_method" title="Yamlint::Rules::Base#config (method)">#config</a></span>, <span class='object_link'><a href="Base.html#level-instance_method" title="Yamlint::Rules::Base#level (method)">#level</a></span></p>
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
<h2>
|
|
128
|
+
Instance Method Summary
|
|
129
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
130
|
+
</h2>
|
|
131
|
+
|
|
132
|
+
<ul class="summary">
|
|
133
|
+
|
|
134
|
+
<li class="public ">
|
|
135
|
+
<span class="summary_signature">
|
|
136
|
+
|
|
137
|
+
<a href="#check-instance_method" title="#check (instance method)">#<strong>check</strong>(context) ⇒ Object </a>
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
</span>
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
152
|
+
|
|
153
|
+
</li>
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
</ul>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="Yamlint::Rules::Base (class)">Base</a></span></h3>
|
|
169
|
+
<p class="inherited"><span class='object_link'><a href="Base.html#defaults-class_method" title="Yamlint::Rules::Base.defaults (method)">defaults</a></span>, <span class='object_link'><a href="Base.html#desc-class_method" title="Yamlint::Rules::Base.desc (method)">desc</a></span>, <span class='object_link'><a href="Base.html#fixable%3F-instance_method" title="Yamlint::Rules::Base#fixable? (method)">#fixable?</a></span>, <span class='object_link'><a href="Base.html#inherited-class_method" title="Yamlint::Rules::Base.inherited (method)">inherited</a></span>, <span class='object_link'><a href="Base.html#initialize-instance_method" title="Yamlint::Rules::Base#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Base.html#rule_id-class_method" title="Yamlint::Rules::Base.rule_id (method)">rule_id</a></span></p>
|
|
170
|
+
<div id="constructor_details" class="method_details_list">
|
|
171
|
+
<h2>Constructor Details</h2>
|
|
172
|
+
|
|
173
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Base.html#initialize-instance_method" title="Yamlint::Rules::Base#initialize (method)">Yamlint::Rules::Base</a></span></p>
|
|
174
|
+
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
<div id="instance_method_details" class="method_details_list">
|
|
179
|
+
<h2>Instance Method Details</h2>
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
<div class="method_details first">
|
|
183
|
+
<h3 class="signature first" id="check-instance_method">
|
|
184
|
+
|
|
185
|
+
#<strong>check</strong>(context) ⇒ <tt>Object</tt>
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
</h3><table class="source_code">
|
|
192
|
+
<tr>
|
|
193
|
+
<td>
|
|
194
|
+
<pre class="lines">
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
12
|
|
198
|
+
13
|
|
199
|
+
14
|
|
200
|
+
15
|
|
201
|
+
16
|
|
202
|
+
17
|
|
203
|
+
18
|
|
204
|
+
19
|
|
205
|
+
20
|
|
206
|
+
21
|
|
207
|
+
22
|
|
208
|
+
23
|
|
209
|
+
24
|
|
210
|
+
25
|
|
211
|
+
26
|
|
212
|
+
27
|
|
213
|
+
28
|
|
214
|
+
29
|
|
215
|
+
30
|
|
216
|
+
31</pre>
|
|
217
|
+
</td>
|
|
218
|
+
<td>
|
|
219
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/rules/key_ordering.rb', line 12</span>
|
|
220
|
+
|
|
221
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_check'>check</span><span class='lparen'>(</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
|
222
|
+
<span class='id identifier rubyid_handler'>handler</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="KeyOrdering/KeyOrderHandler.html" title="Yamlint::Rules::KeyOrdering::KeyOrderHandler (class)">KeyOrderHandler</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="KeyOrdering/KeyOrderHandler.html#initialize-instance_method" title="Yamlint::Rules::KeyOrdering::KeyOrderHandler#initialize (method)">new</a></span></span>
|
|
223
|
+
<span class='id identifier rubyid_parser'>parser</span> <span class='op'>=</span> <span class='const'>Psych</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_handler'>handler</span><span class='rparen'>)</span>
|
|
224
|
+
<span class='id identifier rubyid_handler'>handler</span><span class='period'>.</span><span class='id identifier rubyid_parser'>parser</span> <span class='op'>=</span> <span class='id identifier rubyid_parser'>parser</span>
|
|
225
|
+
|
|
226
|
+
<span class='kw'>begin</span>
|
|
227
|
+
<span class='id identifier rubyid_parser'>parser</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span>
|
|
228
|
+
<span class='kw'>rescue</span> <span class='const'>Psych</span><span class='op'>::</span><span class='const'>SyntaxError</span>
|
|
229
|
+
<span class='kw'>return</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
230
|
+
<span class='kw'>end</span>
|
|
231
|
+
|
|
232
|
+
<span class='id identifier rubyid_handler'>handler</span><span class='period'>.</span><span class='id identifier rubyid_problems'>problems</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_prob'>prob</span><span class='op'>|</span>
|
|
233
|
+
<span class='id identifier rubyid_problem'>problem</span><span class='lparen'>(</span>
|
|
234
|
+
<span class='label'>line:</span> <span class='id identifier rubyid_prob'>prob</span><span class='lbracket'>[</span><span class='symbol'>:line</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
|
235
|
+
<span class='label'>column:</span> <span class='id identifier rubyid_prob'>prob</span><span class='lbracket'>[</span><span class='symbol'>:column</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
|
236
|
+
<span class='label'>message:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>wrong ordering of key \"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_prob'>prob</span><span class='lbracket'>[</span><span class='symbol'>:key</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>\" (should be before \"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_prob'>prob</span><span class='lbracket'>[</span><span class='symbol'>:prev_key</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>\")</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
|
237
|
+
<span class='label'>fixable:</span> <span class='kw'>false</span>
|
|
238
|
+
<span class='rparen'>)</span>
|
|
239
|
+
<span class='kw'>end</span>
|
|
240
|
+
<span class='kw'>end</span></pre>
|
|
241
|
+
</td>
|
|
242
|
+
</tr>
|
|
243
|
+
</table>
|
|
244
|
+
</div>
|
|
245
|
+
|
|
246
|
+
</div>
|
|
247
|
+
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
<div id="footer">
|
|
251
|
+
Generated on Sun Jan 25 08:00:08 2026 by
|
|
252
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
253
|
+
0.9.38 (ruby-4.0.0).
|
|
254
|
+
</div>
|
|
255
|
+
|
|
256
|
+
</div>
|
|
257
|
+
</body>
|
|
258
|
+
</html>
|
|
@@ -0,0 +1,251 @@
|
|
|
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::Rules::LineLength
|
|
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::Rules::LineLength";
|
|
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 (L)</a> »
|
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Yamlint.html" title="Yamlint (module)">Yamlint</a></span></span> » <span class='title'><span class='object_link'><a href="../Rules.html" title="Yamlint::Rules (module)">Rules</a></span></span>
|
|
41
|
+
»
|
|
42
|
+
<span class="title">LineLength</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::Rules::LineLength
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
<dl>
|
|
70
|
+
<dt>Inherits:</dt>
|
|
71
|
+
<dd>
|
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="LineRule.html" title="Yamlint::Rules::LineRule (class)">LineRule</a></span></span>
|
|
73
|
+
|
|
74
|
+
<ul class="fullTree">
|
|
75
|
+
<li>Object</li>
|
|
76
|
+
|
|
77
|
+
<li class="next"><span class='object_link'><a href="Base.html" title="Yamlint::Rules::Base (class)">Base</a></span></li>
|
|
78
|
+
|
|
79
|
+
<li class="next"><span class='object_link'><a href="LineRule.html" title="Yamlint::Rules::LineRule (class)">LineRule</a></span></li>
|
|
80
|
+
|
|
81
|
+
<li class="next">Yamlint::Rules::LineLength</li>
|
|
82
|
+
|
|
83
|
+
</ul>
|
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
85
|
+
|
|
86
|
+
</dd>
|
|
87
|
+
</dl>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
<dl>
|
|
100
|
+
<dt>Defined in:</dt>
|
|
101
|
+
<dd>lib/yamlint/rules/line_length.rb</dd>
|
|
102
|
+
</dl>
|
|
103
|
+
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
<h2>Instance Attribute Summary</h2>
|
|
113
|
+
|
|
114
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="Yamlint::Rules::Base (class)">Base</a></span></h3>
|
|
115
|
+
<p class="inherited"><span class='object_link'><a href="Base.html#config-instance_method" title="Yamlint::Rules::Base#config (method)">#config</a></span>, <span class='object_link'><a href="Base.html#level-instance_method" title="Yamlint::Rules::Base#level (method)">#level</a></span></p>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
<h2>
|
|
120
|
+
Instance Method Summary
|
|
121
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
122
|
+
</h2>
|
|
123
|
+
|
|
124
|
+
<ul class="summary">
|
|
125
|
+
|
|
126
|
+
<li class="public ">
|
|
127
|
+
<span class="summary_signature">
|
|
128
|
+
|
|
129
|
+
<a href="#check_line-instance_method" title="#check_line (instance method)">#<strong>check_line</strong>(line, line_number, _context) ⇒ Object </a>
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
</span>
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
144
|
+
|
|
145
|
+
</li>
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
</ul>
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="LineRule.html" title="Yamlint::Rules::LineRule (class)">LineRule</a></span></h3>
|
|
161
|
+
<p class="inherited"><span class='object_link'><a href="LineRule.html#check-instance_method" title="Yamlint::Rules::LineRule#check (method)">#check</a></span></p>
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="Yamlint::Rules::Base (class)">Base</a></span></h3>
|
|
172
|
+
<p class="inherited"><span class='object_link'><a href="Base.html#check-instance_method" title="Yamlint::Rules::Base#check (method)">#check</a></span>, <span class='object_link'><a href="Base.html#defaults-class_method" title="Yamlint::Rules::Base.defaults (method)">defaults</a></span>, <span class='object_link'><a href="Base.html#desc-class_method" title="Yamlint::Rules::Base.desc (method)">desc</a></span>, <span class='object_link'><a href="Base.html#fixable%3F-instance_method" title="Yamlint::Rules::Base#fixable? (method)">#fixable?</a></span>, <span class='object_link'><a href="Base.html#inherited-class_method" title="Yamlint::Rules::Base.inherited (method)">inherited</a></span>, <span class='object_link'><a href="Base.html#initialize-instance_method" title="Yamlint::Rules::Base#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Base.html#rule_id-class_method" title="Yamlint::Rules::Base.rule_id (method)">rule_id</a></span></p>
|
|
173
|
+
<div id="constructor_details" class="method_details_list">
|
|
174
|
+
<h2>Constructor Details</h2>
|
|
175
|
+
|
|
176
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Base.html#initialize-instance_method" title="Yamlint::Rules::Base#initialize (method)">Yamlint::Rules::Base</a></span></p>
|
|
177
|
+
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
<div id="instance_method_details" class="method_details_list">
|
|
182
|
+
<h2>Instance Method Details</h2>
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
<div class="method_details first">
|
|
186
|
+
<h3 class="signature first" id="check_line-instance_method">
|
|
187
|
+
|
|
188
|
+
#<strong>check_line</strong>(line, line_number, _context) ⇒ <tt>Object</tt>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
</h3><table class="source_code">
|
|
195
|
+
<tr>
|
|
196
|
+
<td>
|
|
197
|
+
<pre class="lines">
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
14
|
|
201
|
+
15
|
|
202
|
+
16
|
|
203
|
+
17
|
|
204
|
+
18
|
|
205
|
+
19
|
|
206
|
+
20
|
|
207
|
+
21
|
|
208
|
+
22
|
|
209
|
+
23
|
|
210
|
+
24
|
|
211
|
+
25
|
|
212
|
+
26
|
|
213
|
+
27
|
|
214
|
+
28</pre>
|
|
215
|
+
</td>
|
|
216
|
+
<td>
|
|
217
|
+
<pre class="code"><span class="info file"># File 'lib/yamlint/rules/line_length.rb', line 14</span>
|
|
218
|
+
|
|
219
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_check_line'>check_line</span><span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span><span class='comma'>,</span> <span class='id identifier rubyid_line_number'>line_number</span><span class='comma'>,</span> <span class='id identifier rubyid__context'>_context</span><span class='rparen'>)</span>
|
|
220
|
+
<span class='id identifier rubyid_max_length'>max_length</span> <span class='op'>=</span> <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='symbol'>:max</span><span class='rbracket'>]</span>
|
|
221
|
+
<span class='id identifier rubyid_actual_length'>actual_length</span> <span class='op'>=</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_chomp'>chomp</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
|
|
222
|
+
|
|
223
|
+
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_actual_length'>actual_length</span> <span class='op'><=</span> <span class='id identifier rubyid_max_length'>max_length</span>
|
|
224
|
+
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_allow_non_breakable_words?'>allow_non_breakable_words?</span> <span class='op'>&&</span> <span class='id identifier rubyid_non_breakable_word?'>non_breakable_word?</span><span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span><span class='rparen'>)</span>
|
|
225
|
+
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_allow_non_breakable_inline_mappings?'>allow_non_breakable_inline_mappings?</span> <span class='op'>&&</span> <span class='id identifier rubyid_inline_mapping?'>inline_mapping?</span><span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span><span class='rparen'>)</span>
|
|
226
|
+
|
|
227
|
+
<span class='id identifier rubyid_problem'>problem</span><span class='lparen'>(</span>
|
|
228
|
+
<span class='label'>line:</span> <span class='id identifier rubyid_line_number'>line_number</span><span class='comma'>,</span>
|
|
229
|
+
<span class='label'>column:</span> <span class='id identifier rubyid_max_length'>max_length</span> <span class='op'>+</span> <span class='int'>1</span><span class='comma'>,</span>
|
|
230
|
+
<span class='label'>message:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>line too long (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_actual_length'>actual_length</span><span class='embexpr_end'>}</span><span class='tstring_content'> > </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_max_length'>max_length</span><span class='embexpr_end'>}</span><span class='tstring_content'> characters)</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
|
231
|
+
<span class='label'>fixable:</span> <span class='kw'>false</span>
|
|
232
|
+
<span class='rparen'>)</span>
|
|
233
|
+
<span class='kw'>end</span></pre>
|
|
234
|
+
</td>
|
|
235
|
+
</tr>
|
|
236
|
+
</table>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
</div>
|
|
242
|
+
|
|
243
|
+
<div id="footer">
|
|
244
|
+
Generated on Sun Jan 25 08:00:08 2026 by
|
|
245
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
246
|
+
0.9.38 (ruby-4.0.0).
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
</div>
|
|
250
|
+
</body>
|
|
251
|
+
</html>
|