inspecstyle 0.1.3 → 0.2.1
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/Gemfile.lock +2 -2
- data/README.md +37 -0
- data/config/default.yml +95 -2
- data/doc/RuboCop.html +3 -3
- data/doc/RuboCop/Cop.html +3 -3
- data/doc/RuboCop/Cop/InSpecStyle.html +4 -4
- data/doc/RuboCop/Cop/InSpecStyle/Apache.html +306 -0
- data/doc/RuboCop/Cop/InSpecStyle/AwsIamUserProperty.html +358 -0
- data/doc/RuboCop/Cop/InSpecStyle/AzureGenericResource.html +6 -5
- data/doc/RuboCop/Cop/InSpecStyle/DeprecatedAttributes.html +3 -2
- data/doc/RuboCop/Cop/InSpecStyle/DeprecatedAttributes1.html +311 -0
- data/doc/RuboCop/Cop/InSpecStyle/FileBeMounted.html +250 -0
- data/doc/RuboCop/Cop/InSpecStyle/FileSize.html +315 -0
- data/doc/RuboCop/Cop/InSpecStyle/HostProto.html +315 -0
- data/doc/RuboCop/Cop/InSpecStyle/IisWebsite.html +294 -0
- data/doc/RuboCop/Cop/InSpecStyle/LinuxKernelParameter.html +296 -0
- data/doc/RuboCop/Cop/InSpecStyle/MSSQLSessionPass.html +319 -0
- data/doc/RuboCop/Cop/InSpecStyle/OracleDbSessionPass.html +319 -0
- data/doc/RuboCop/Cop/InSpecStyle/PPAResource.html +294 -0
- data/doc/RuboCop/Cop/InSpecStyle/ProcessesList.html +315 -0
- data/doc/RuboCop/Cop/InSpecStyle/ScriptResource.html +298 -0
- data/doc/RuboCop/Cop/InSpecStyle/ShadowProperties.html +334 -0
- data/doc/RuboCop/Cop/InSpecStyle/UsersResourceMatchers.html +357 -0
- data/doc/RuboCop/Cop/InSpecStyle/WindowsRegistryKey.html +294 -0
- data/doc/RuboCop/Cop/InSpecStyle/WmiWmisClass.html +294 -0
- data/doc/RuboCop/InSpecStyle.html +2 -2
- data/doc/RuboCop/InSpecStyle/Error.html +1 -1
- data/doc/RuboCop/InSpecStyle/Inject.html +1 -1
- data/doc/_index.html +181 -2
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +24 -2
- data/doc/index.html +24 -2
- data/doc/method_list.html +254 -6
- data/doc/top-level-namespace.html +1 -1
- data/lib/rubocop/cop/inspecstyle/apache.rb +57 -0
- data/lib/rubocop/cop/inspecstyle/aws_iam_user_property.rb +96 -0
- data/lib/rubocop/cop/inspecstyle/azure_generic_resource.rb +2 -1
- data/lib/rubocop/cop/inspecstyle/deprecated_attributes.rb +2 -2
- data/lib/rubocop/cop/inspecstyle/deprecated_attributes1.rb +52 -0
- data/lib/rubocop/cop/inspecstyle/file_be_mounted.rb +65 -0
- data/lib/rubocop/cop/inspecstyle/file_size.rb +77 -0
- data/lib/rubocop/cop/inspecstyle/host_proto.rb +71 -0
- data/lib/rubocop/cop/inspecstyle/iis_website.rb +36 -0
- data/lib/rubocop/cop/inspecstyle/linux_kernel_parameter.rb +41 -0
- data/lib/rubocop/cop/inspecstyle/mssql_session_pass.rb +59 -0
- data/lib/rubocop/cop/inspecstyle/oracle_db_session_pass.rb +59 -0
- data/lib/rubocop/cop/inspecstyle/ppa_resource.rb +36 -0
- data/lib/rubocop/cop/inspecstyle/processes_list.rb +77 -0
- data/lib/rubocop/cop/inspecstyle/script_resource.rb +48 -0
- data/lib/rubocop/cop/inspecstyle/shadow_properties.rb +83 -0
- data/lib/rubocop/cop/inspecstyle/users_resource_matchers.rb +98 -0
- data/lib/rubocop/cop/inspecstyle/windows_registry_key.rb +36 -0
- data/lib/rubocop/cop/inspecstyle/wmi_wmis_class.rb +37 -0
- data/lib/rubocop/cop/inspecstyle_cops.rb +18 -2
- data/lib/rubocop/inspecstyle/version.rb +1 -1
- data/notes-for-development.md +10 -0
- metadata +36 -3
- data/lib/rubocop/cop/inspecstyle/first_cop.rb +0 -69
@@ -0,0 +1,358 @@
|
|
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: RuboCop::Cop::InSpecStyle::AwsIamUserProperty
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.25
|
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 = "RuboCop::Cop::InSpecStyle::AwsIamUserProperty";
|
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 (A)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../../RuboCop.html" title="RuboCop (module)">RuboCop</a></span></span> » <span class='title'><span class='object_link'><a href="../../Cop.html" title="RuboCop::Cop (module)">Cop</a></span></span> » <span class='title'><span class='object_link'><a href="../InSpecStyle.html" title="RuboCop::Cop::InSpecStyle (module)">InSpecStyle</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">AwsIamUserProperty</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: RuboCop::Cop::InSpecStyle::AwsIamUserProperty
|
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="../../Cop.html" title="RuboCop::Cop (module)">RuboCop::Cop</a></span></span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next"><span class='object_link'><a href="../../Cop.html" title="RuboCop::Cop (module)">RuboCop::Cop</a></span></li>
|
78
|
+
|
79
|
+
<li class="next">RuboCop::Cop::InSpecStyle::AwsIamUserProperty</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
83
|
+
|
84
|
+
</dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
<dl>
|
93
|
+
<dt>Includes:</dt>
|
94
|
+
<dd>RangeHelp</dd>
|
95
|
+
</dl>
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<dl>
|
103
|
+
<dt>Defined in:</dt>
|
104
|
+
<dd>lib/rubocop/cop/inspecstyle/aws_iam_user_property.rb</dd>
|
105
|
+
</dl>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<h2>Overview</h2><div class="docstring">
|
110
|
+
<div class="discussion">
|
111
|
+
|
112
|
+
<p>aws_iam_users resource properties `user|password|last_change|expiry_date|line` is deprecated in favor of `users|passwords|last_changes|expiry_dates|lines`</p>
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
<div class="tags">
|
118
|
+
|
119
|
+
<div class="examples">
|
120
|
+
<p class="tag_title">Examples:</p>
|
121
|
+
|
122
|
+
|
123
|
+
<p class="example_title"><div class='inline'>
|
124
|
+
<p>EnforcedStyle: InSpecStyle (default)</p>
|
125
|
+
</div></p>
|
126
|
+
|
127
|
+
<pre class="example code"><code><span class='comment'># Use users instead
|
128
|
+
</span>
|
129
|
+
<span class='comment'># bad
|
130
|
+
</span><span class='id identifier rubyid_describe'>describe</span> <span class='id identifier rubyid_aws_iam_user'>aws_iam_user</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/etc/my-custom-place/aws_iam_user</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
|
131
|
+
<span class='id identifier rubyid_its'>its</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>name</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_should'>should</span> <span class='id identifier rubyid_eq'>eq</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>user</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span>
|
132
|
+
<span class='kw'>end</span>
|
133
|
+
|
134
|
+
<span class='comment'># good
|
135
|
+
</span><span class='id identifier rubyid_describe'>describe</span> <span class='id identifier rubyid_aws_iam_user'>aws_iam_user</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/etc/my-custom-place/aws_iam_user</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
|
136
|
+
<span class='id identifier rubyid_its'>its</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>username</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_should'>should</span> <span class='id identifier rubyid_eq'>eq</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>user</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span>
|
137
|
+
<span class='kw'>end</span></code></pre>
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
|
142
|
+
</div>
|
143
|
+
|
144
|
+
<h2>
|
145
|
+
Constant Summary
|
146
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
147
|
+
</h2>
|
148
|
+
|
149
|
+
<dl class="constants">
|
150
|
+
|
151
|
+
<dt id="MSG-constant" class="">MSG =
|
152
|
+
|
153
|
+
</dt>
|
154
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Use `:%<solution>s` instead of `:%<violation>s` as a property </span><span class='tstring_end'>'</span></span> \
|
155
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>for the `aws_iam_user` resource. This property will be removed in InSpec 5</span><span class='tstring_end'>'</span></span></pre></dd>
|
156
|
+
|
157
|
+
<dt id="MAP-constant" class="">MAP =
|
158
|
+
|
159
|
+
</dt>
|
160
|
+
<dd><pre class="code"><span class='lbrace'>{</span>
|
161
|
+
<span class='label'>user:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>aws_user_struct</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
162
|
+
<span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>username</span><span class='tstring_end'>"</span></span>
|
163
|
+
<span class='rbrace'>}</span></pre></dd>
|
164
|
+
|
165
|
+
</dl>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
<h2>
|
176
|
+
Instance Method Summary
|
177
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
178
|
+
</h2>
|
179
|
+
|
180
|
+
<ul class="summary">
|
181
|
+
|
182
|
+
<li class="public ">
|
183
|
+
<span class="summary_signature">
|
184
|
+
|
185
|
+
<a href="#autocorrect-instance_method" title="#autocorrect (instance method)">#<strong>autocorrect</strong>(node) ⇒ Object </a>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
</span>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
200
|
+
|
201
|
+
</li>
|
202
|
+
|
203
|
+
|
204
|
+
<li class="public ">
|
205
|
+
<span class="summary_signature">
|
206
|
+
|
207
|
+
<a href="#on_block-instance_method" title="#on_block (instance method)">#<strong>on_block</strong>(node) ⇒ Object </a>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</span>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
222
|
+
|
223
|
+
</li>
|
224
|
+
|
225
|
+
|
226
|
+
</ul>
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
<div id="instance_method_details" class="method_details_list">
|
239
|
+
<h2>Instance Method Details</h2>
|
240
|
+
|
241
|
+
|
242
|
+
<div class="method_details first">
|
243
|
+
<h3 class="signature first" id="autocorrect-instance_method">
|
244
|
+
|
245
|
+
#<strong>autocorrect</strong>(node) ⇒ <tt>Object</tt>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
</h3><table class="source_code">
|
252
|
+
<tr>
|
253
|
+
<td>
|
254
|
+
<pre class="lines">
|
255
|
+
|
256
|
+
|
257
|
+
70
|
258
|
+
71
|
259
|
+
72
|
260
|
+
73
|
261
|
+
74
|
262
|
+
75
|
263
|
+
76
|
264
|
+
77
|
265
|
+
78
|
266
|
+
79
|
267
|
+
80
|
268
|
+
81</pre>
|
269
|
+
</td>
|
270
|
+
<td>
|
271
|
+
<pre class="code"><span class="info file"># File 'lib/rubocop/cop/inspecstyle/aws_iam_user_property.rb', line 70</span>
|
272
|
+
|
273
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_autocorrect'>autocorrect</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
|
274
|
+
<span class='id identifier rubyid_lambda'>lambda</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_corrector'>corrector</span><span class='op'>|</span>
|
275
|
+
<span class='kw'>case</span> <span class='id identifier rubyid_node'>node</span><span class='period'>.</span><span class='id identifier rubyid_children'>children</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_children'>children</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span>
|
276
|
+
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>s(:str, \"name\")</span><span class='tstring_end'>"</span></span>
|
277
|
+
<span class='id identifier rubyid_corrector'>corrector</span><span class='period'>.</span><span class='id identifier rubyid_replace'>replace</span><span class='lparen'>(</span><span class='id identifier rubyid_offense_range'>offense_range</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>username</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
278
|
+
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>s(:str, \"user\")</span><span class='tstring_end'>"</span></span>
|
279
|
+
<span class='id identifier rubyid_corrector'>corrector</span><span class='period'>.</span><span class='id identifier rubyid_replace'>replace</span><span class='lparen'>(</span><span class='id identifier rubyid_offense_range'>offense_range</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>aws_user_struct</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
280
|
+
<span class='kw'>else</span>
|
281
|
+
<span class='kw'>break</span>
|
282
|
+
<span class='kw'>end</span>
|
283
|
+
<span class='kw'>end</span>
|
284
|
+
<span class='kw'>end</span></pre>
|
285
|
+
</td>
|
286
|
+
</tr>
|
287
|
+
</table>
|
288
|
+
</div>
|
289
|
+
|
290
|
+
<div class="method_details ">
|
291
|
+
<h3 class="signature " id="on_block-instance_method">
|
292
|
+
|
293
|
+
#<strong>on_block</strong>(node) ⇒ <tt>Object</tt>
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
</h3><table class="source_code">
|
300
|
+
<tr>
|
301
|
+
<td>
|
302
|
+
<pre class="lines">
|
303
|
+
|
304
|
+
|
305
|
+
53
|
306
|
+
54
|
307
|
+
55
|
308
|
+
56
|
309
|
+
57
|
310
|
+
58
|
311
|
+
59
|
312
|
+
60
|
313
|
+
61
|
314
|
+
62
|
315
|
+
63
|
316
|
+
64
|
317
|
+
65
|
318
|
+
66
|
319
|
+
67
|
320
|
+
68</pre>
|
321
|
+
</td>
|
322
|
+
<td>
|
323
|
+
<pre class="code"><span class="info file"># File 'lib/rubocop/cop/inspecstyle/aws_iam_user_property.rb', line 53</span>
|
324
|
+
|
325
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_block'>on_block</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
|
326
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_inside_aws_iam_users_spec?'>inside_aws_iam_users_spec?</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
|
327
|
+
<span class='id identifier rubyid_node'>node</span><span class='period'>.</span><span class='id identifier rubyid_descendants'>descendants</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_descendant'>descendant</span><span class='op'>|</span>
|
328
|
+
<span class='id identifier rubyid_deprecated_aws_iam_users_property?'>deprecated_aws_iam_users_property?</span><span class='lparen'>(</span><span class='id identifier rubyid_descendant'>descendant</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_violation'>violation</span><span class='op'>|</span>
|
329
|
+
<span class='id identifier rubyid_add_offense'>add_offense</span><span class='lparen'>(</span>
|
330
|
+
<span class='id identifier rubyid_descendant'>descendant</span><span class='comma'>,</span>
|
331
|
+
<span class='label'>location:</span> <span class='id identifier rubyid_offense_range'>offense_range</span><span class='lparen'>(</span><span class='id identifier rubyid_descendant'>descendant</span><span class='rparen'>)</span><span class='comma'>,</span>
|
332
|
+
<span class='label'>message:</span> <span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span>
|
333
|
+
<span class='const'><span class='object_link'><a href="#MSG-constant" title="RuboCop::Cop::InSpecStyle::AwsIamUserProperty::MSG (constant)">MSG</a></span></span><span class='comma'>,</span>
|
334
|
+
<span class='label'>violation:</span> <span class='id identifier rubyid_violation'>violation</span><span class='comma'>,</span>
|
335
|
+
<span class='label'>solution:</span> <span class='const'><span class='object_link'><a href="#MAP-constant" title="RuboCop::Cop::InSpecStyle::AwsIamUserProperty::MAP (constant)">MAP</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_violation'>violation</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span>
|
336
|
+
<span class='rparen'>)</span>
|
337
|
+
<span class='rparen'>)</span>
|
338
|
+
<span class='kw'>end</span>
|
339
|
+
<span class='kw'>end</span>
|
340
|
+
<span class='kw'>end</span></pre>
|
341
|
+
</td>
|
342
|
+
</tr>
|
343
|
+
</table>
|
344
|
+
</div>
|
345
|
+
|
346
|
+
</div>
|
347
|
+
|
348
|
+
</div>
|
349
|
+
|
350
|
+
<div id="footer">
|
351
|
+
Generated on Thu Jul 2 15:33:00 2020 by
|
352
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
353
|
+
0.9.25 (ruby-2.6.6).
|
354
|
+
</div>
|
355
|
+
|
356
|
+
</div>
|
357
|
+
</body>
|
358
|
+
</html>
|
@@ -121,6 +121,7 @@
|
|
121
121
|
|
122
122
|
<pre class="example code"><code><span class='comment'># azure_generic_resource has been deprecated
|
123
123
|
</span><span class='comment'># 'https://github.com/inspec/inspec/issues/3131'
|
124
|
+
</span><span class='comment'># Since there are multiples replacements autocorrect is not supported.
|
124
125
|
</span>
|
125
126
|
<span class='comment'># bad
|
126
127
|
</span><span class='id identifier rubyid_azure_generic_resource'>azure_generic_resource</span>
|
@@ -215,19 +216,19 @@
|
|
215
216
|
<pre class="lines">
|
216
217
|
|
217
218
|
|
218
|
-
26
|
219
219
|
27
|
220
220
|
28
|
221
221
|
29
|
222
|
-
30
|
222
|
+
30
|
223
|
+
31</pre>
|
223
224
|
</td>
|
224
225
|
<td>
|
225
|
-
<pre class="code"><span class="info file"># File 'lib/rubocop/cop/inspecstyle/azure_generic_resource.rb', line
|
226
|
+
<pre class="code"><span class="info file"># File 'lib/rubocop/cop/inspecstyle/azure_generic_resource.rb', line 27</span>
|
226
227
|
|
227
228
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_send'>on_send</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
|
228
229
|
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_azure_generic_resource?'>azure_generic_resource?</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
|
229
230
|
|
230
|
-
<span class='id identifier rubyid_add_offense'>add_offense</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='comma'>,</span> <span class='label'>location:</span> <span class='
|
231
|
+
<span class='id identifier rubyid_add_offense'>add_offense</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='comma'>,</span> <span class='label'>location:</span> <span class='symbol'>:selector</span><span class='rparen'>)</span>
|
231
232
|
<span class='kw'>end</span></pre>
|
232
233
|
</td>
|
233
234
|
</tr>
|
@@ -239,7 +240,7 @@
|
|
239
240
|
</div>
|
240
241
|
|
241
242
|
<div id="footer">
|
242
|
-
Generated on Thu
|
243
|
+
Generated on Thu Jul 2 15:33:00 2020 by
|
243
244
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
244
245
|
0.9.25 (ruby-2.6.6).
|
245
246
|
</div>
|
@@ -148,7 +148,8 @@
|
|
148
148
|
<dt id="MSG-constant" class="">MSG =
|
149
149
|
|
150
150
|
</dt>
|
151
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Use `#input` instead of `#attribute
|
151
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Use `#input` instead of `#attribute`. This will be removed in </span><span class='tstring_end'>'</span></span>\
|
152
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>InSpec 5</span><span class='tstring_end'>'</span></span></pre></dd>
|
152
153
|
|
153
154
|
</dl>
|
154
155
|
|
@@ -300,7 +301,7 @@
|
|
300
301
|
</div>
|
301
302
|
|
302
303
|
<div id="footer">
|
303
|
-
Generated on Thu
|
304
|
+
Generated on Thu Jul 2 15:33:00 2020 by
|
304
305
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
305
306
|
0.9.25 (ruby-2.6.6).
|
306
307
|
</div>
|
@@ -0,0 +1,311 @@
|
|
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: RuboCop::Cop::InSpecStyle::DeprecatedAttributes1
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.25
|
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 = "RuboCop::Cop::InSpecStyle::DeprecatedAttributes1";
|
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 (D)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../../RuboCop.html" title="RuboCop (module)">RuboCop</a></span></span> » <span class='title'><span class='object_link'><a href="../../Cop.html" title="RuboCop::Cop (module)">Cop</a></span></span> » <span class='title'><span class='object_link'><a href="../InSpecStyle.html" title="RuboCop::Cop::InSpecStyle (module)">InSpecStyle</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">DeprecatedAttributes1</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: RuboCop::Cop::InSpecStyle::DeprecatedAttributes1
|
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="../../Cop.html" title="RuboCop::Cop (module)">RuboCop::Cop</a></span></span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next"><span class='object_link'><a href="../../Cop.html" title="RuboCop::Cop (module)">RuboCop::Cop</a></span></li>
|
78
|
+
|
79
|
+
<li class="next">RuboCop::Cop::InSpecStyle::DeprecatedAttributes1</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
83
|
+
|
84
|
+
</dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
<dl>
|
93
|
+
<dt>Includes:</dt>
|
94
|
+
<dd>RangeHelp</dd>
|
95
|
+
</dl>
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<dl>
|
103
|
+
<dt>Defined in:</dt>
|
104
|
+
<dd>lib/rubocop/cop/inspecstyle/deprecated_attributes1.rb</dd>
|
105
|
+
</dl>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<h2>Overview</h2><div class="docstring">
|
110
|
+
<div class="discussion">
|
111
|
+
|
112
|
+
<p>Checks if deprecated method attribute1 is used.</p>
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
<div class="tags">
|
118
|
+
|
119
|
+
<div class="examples">
|
120
|
+
<p class="tag_title">Examples:</p>
|
121
|
+
|
122
|
+
|
123
|
+
<p class="example_title"><div class='inline'>
|
124
|
+
<p>EnforcedStyle: InSpecStyle (default)</p>
|
125
|
+
</div></p>
|
126
|
+
|
127
|
+
<pre class="example code"><code><span class='comment'># Attributes have been deprecated for inputs
|
128
|
+
</span><span class='comment'># https://github.com/inspec/inspec/issues/3802
|
129
|
+
</span>
|
130
|
+
<span class='comment'># bad
|
131
|
+
</span><span class='id identifier rubyid_attribute1'>attribute1</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_element</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>value:</span> <span class='int'>10</span><span class='rparen'>)</span>
|
132
|
+
|
133
|
+
<span class='comment'># good
|
134
|
+
</span><span class='id identifier rubyid_input'>input</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_element</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>value:</span> <span class='int'>10</span><span class='rparen'>)</span></code></pre>
|
135
|
+
|
136
|
+
</div>
|
137
|
+
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
<h2>
|
142
|
+
Constant Summary
|
143
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
144
|
+
</h2>
|
145
|
+
|
146
|
+
<dl class="constants">
|
147
|
+
|
148
|
+
<dt id="MSG-constant" class="">MSG =
|
149
|
+
|
150
|
+
</dt>
|
151
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Use `#input` instead of `#attribute1`. This will be removed in </span><span class='tstring_end'>'</span></span>\
|
152
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>InSpec 5</span><span class='tstring_end'>'</span></span></pre></dd>
|
153
|
+
|
154
|
+
</dl>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
<h2>
|
165
|
+
Instance Method Summary
|
166
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
167
|
+
</h2>
|
168
|
+
|
169
|
+
<ul class="summary">
|
170
|
+
|
171
|
+
<li class="public ">
|
172
|
+
<span class="summary_signature">
|
173
|
+
|
174
|
+
<a href="#autocorrect-instance_method" title="#autocorrect (instance method)">#<strong>autocorrect</strong>(node) ⇒ Object </a>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
</span>
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
189
|
+
|
190
|
+
</li>
|
191
|
+
|
192
|
+
|
193
|
+
<li class="public ">
|
194
|
+
<span class="summary_signature">
|
195
|
+
|
196
|
+
<a href="#on_send-instance_method" title="#on_send (instance method)">#<strong>on_send</strong>(node) ⇒ Object </a>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
</span>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
211
|
+
|
212
|
+
</li>
|
213
|
+
|
214
|
+
|
215
|
+
</ul>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
<div id="instance_method_details" class="method_details_list">
|
228
|
+
<h2>Instance Method Details</h2>
|
229
|
+
|
230
|
+
|
231
|
+
<div class="method_details first">
|
232
|
+
<h3 class="signature first" id="autocorrect-instance_method">
|
233
|
+
|
234
|
+
#<strong>autocorrect</strong>(node) ⇒ <tt>Object</tt>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
</h3><table class="source_code">
|
241
|
+
<tr>
|
242
|
+
<td>
|
243
|
+
<pre class="lines">
|
244
|
+
|
245
|
+
|
246
|
+
34
|
247
|
+
35
|
248
|
+
36
|
249
|
+
37
|
250
|
+
38</pre>
|
251
|
+
</td>
|
252
|
+
<td>
|
253
|
+
<pre class="code"><span class="info file"># File 'lib/rubocop/cop/inspecstyle/deprecated_attributes1.rb', line 34</span>
|
254
|
+
|
255
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_autocorrect'>autocorrect</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
|
256
|
+
<span class='id identifier rubyid_lambda'>lambda</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_corrector'>corrector</span><span class='op'>|</span>
|
257
|
+
<span class='id identifier rubyid_corrector'>corrector</span><span class='period'>.</span><span class='id identifier rubyid_replace'>replace</span><span class='lparen'>(</span><span class='id identifier rubyid_offense_range'>offense_range</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_preferred_replacement'>preferred_replacement</span><span class='rparen'>)</span>
|
258
|
+
<span class='kw'>end</span>
|
259
|
+
<span class='kw'>end</span></pre>
|
260
|
+
</td>
|
261
|
+
</tr>
|
262
|
+
</table>
|
263
|
+
</div>
|
264
|
+
|
265
|
+
<div class="method_details ">
|
266
|
+
<h3 class="signature " id="on_send-instance_method">
|
267
|
+
|
268
|
+
#<strong>on_send</strong>(node) ⇒ <tt>Object</tt>
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
</h3><table class="source_code">
|
275
|
+
<tr>
|
276
|
+
<td>
|
277
|
+
<pre class="lines">
|
278
|
+
|
279
|
+
|
280
|
+
28
|
281
|
+
29
|
282
|
+
30
|
283
|
+
31
|
284
|
+
32</pre>
|
285
|
+
</td>
|
286
|
+
<td>
|
287
|
+
<pre class="code"><span class="info file"># File 'lib/rubocop/cop/inspecstyle/deprecated_attributes1.rb', line 28</span>
|
288
|
+
|
289
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_send'>on_send</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
|
290
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_attribute1?'>attribute1?</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
|
291
|
+
|
292
|
+
<span class='id identifier rubyid_add_offense'>add_offense</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='comma'>,</span> <span class='label'>location:</span> <span class='id identifier rubyid_node'>node</span><span class='period'>.</span><span class='id identifier rubyid_loc'>loc</span><span class='period'>.</span><span class='id identifier rubyid_selector'>selector</span><span class='rparen'>)</span>
|
293
|
+
<span class='kw'>end</span></pre>
|
294
|
+
</td>
|
295
|
+
</tr>
|
296
|
+
</table>
|
297
|
+
</div>
|
298
|
+
|
299
|
+
</div>
|
300
|
+
|
301
|
+
</div>
|
302
|
+
|
303
|
+
<div id="footer">
|
304
|
+
Generated on Thu Jul 2 15:33:00 2020 by
|
305
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
306
|
+
0.9.25 (ruby-2.6.6).
|
307
|
+
</div>
|
308
|
+
|
309
|
+
</div>
|
310
|
+
</body>
|
311
|
+
</html>
|