rubocop-sketchup 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +20 -21
- data/assets/output.html.erb +301 -301
- data/config/default.yml +379 -379
- data/lib/rubocop/sketchup/config.rb +63 -63
- data/lib/rubocop/sketchup/cop/bugs/material_name.rb +108 -108
- data/lib/rubocop/sketchup/cop/bugs/render_mode.rb +72 -72
- data/lib/rubocop/sketchup/cop/bugs/uniform_scaling.rb +36 -36
- data/lib/rubocop/sketchup/cop/deprecations/add_separator_to_menu.rb +25 -25
- data/lib/rubocop/sketchup/cop/deprecations/operation_next_transparent.rb +30 -30
- data/lib/rubocop/sketchup/cop/deprecations/require_all.rb +27 -27
- data/lib/rubocop/sketchup/cop/deprecations/set_texture_projection.rb +26 -26
- data/lib/rubocop/sketchup/cop/deprecations/show_ruby_panel.rb +25 -25
- data/lib/rubocop/sketchup/cop/deprecations/sketchup_set.rb +30 -30
- data/lib/rubocop/sketchup/cop/performance/openssl.rb +41 -41
- data/lib/rubocop/sketchup/cop/performance/operation_disable_ui.rb +33 -33
- data/lib/rubocop/sketchup/cop/performance/selection_bulk.rb +79 -79
- data/lib/rubocop/sketchup/cop/performance/type_check.rb +63 -63
- data/lib/rubocop/sketchup/cop/performance/typename.rb +24 -24
- data/lib/rubocop/sketchup/cop/requirements/api_namespace.rb +30 -30
- data/lib/rubocop/sketchup/cop/requirements/exit.rb +33 -33
- data/lib/rubocop/sketchup/cop/requirements/extension_namespace.rb +125 -125
- data/lib/rubocop/sketchup/cop/requirements/file_structure.rb +97 -97
- data/lib/rubocop/sketchup/cop/requirements/gem_install.rb +45 -45
- data/lib/rubocop/sketchup/cop/requirements/get_extension_license.rb +95 -95
- data/lib/rubocop/sketchup/cop/requirements/global_constants.rb +38 -38
- data/lib/rubocop/sketchup/cop/requirements/global_include.rb +42 -42
- data/lib/rubocop/sketchup/cop/requirements/global_methods.rb +65 -65
- data/lib/rubocop/sketchup/cop/requirements/global_variables.rb +95 -95
- data/lib/rubocop/sketchup/cop/requirements/language_handler_globals.rb +46 -46
- data/lib/rubocop/sketchup/cop/requirements/load_path.rb +83 -83
- data/lib/rubocop/sketchup/cop/requirements/minimal_registration.rb +73 -73
- data/lib/rubocop/sketchup/cop/requirements/observers_start_operation.rb +161 -161
- data/lib/rubocop/sketchup/cop/requirements/register_extension.rb +45 -45
- data/lib/rubocop/sketchup/cop/requirements/ruby_core_namespace.rb +291 -291
- data/lib/rubocop/sketchup/cop/requirements/ruby_stdlib_namespace.rb +634 -634
- data/lib/rubocop/sketchup/cop/requirements/shipped_extensions_namespace.rb +61 -61
- data/lib/rubocop/sketchup/cop/requirements/sketchup_extension.rb +119 -119
- data/lib/rubocop/sketchup/cop/requirements/sketchup_require.rb +150 -149
- data/lib/rubocop/sketchup/cop/suggestions/add_group.rb +49 -49
- data/lib/rubocop/sketchup/cop/suggestions/compatibility.rb +128 -128
- data/lib/rubocop/sketchup/cop/suggestions/dc_internals.rb +34 -34
- data/lib/rubocop/sketchup/cop/suggestions/file_encoding.rb +78 -78
- data/lib/rubocop/sketchup/cop/suggestions/model_entities.rb +58 -58
- data/lib/rubocop/sketchup/cop/suggestions/monkey_patched_api.rb +45 -45
- data/lib/rubocop/sketchup/cop/suggestions/operation_name.rb +137 -137
- data/lib/rubocop/sketchup/cop/suggestions/sketchup_find_support_file.rb +39 -39
- data/lib/rubocop/sketchup/cop/suggestions/tool_drawing_bounds.rb +45 -45
- data/lib/rubocop/sketchup/cop/suggestions/tool_invalidate.rb +68 -68
- data/lib/rubocop/sketchup/cop/suggestions/tool_user_input.rb +41 -41
- data/lib/rubocop/sketchup/cop/suggestions/toolbar_timer.rb +65 -65
- data/lib/rubocop/sketchup/cop.rb +110 -110
- data/lib/rubocop/sketchup/dc_globals.rb +24 -24
- data/lib/rubocop/sketchup/dc_methods.rb +130 -130
- data/lib/rubocop/sketchup/extension_project.rb +65 -65
- data/lib/rubocop/sketchup/features.rb +1477 -1420
- data/lib/rubocop/sketchup/formatter/extension_review.rb +269 -269
- data/lib/rubocop/sketchup/inject.rb +19 -19
- data/lib/rubocop/sketchup/namespace.rb +49 -49
- data/lib/rubocop/sketchup/namespace_checker.rb +103 -103
- data/lib/rubocop/sketchup/no_comment_disable.rb +17 -17
- data/lib/rubocop/sketchup/range_help.rb +52 -52
- data/lib/rubocop/sketchup/sketchup_target_range.rb +75 -75
- data/lib/rubocop/sketchup/sketchup_version.rb +129 -128
- data/lib/rubocop/sketchup/tool_checker.rb +41 -43
- data/lib/rubocop/sketchup/version.rb +7 -7
- data/lib/rubocop/sketchup.rb +14 -14
- data/lib/rubocop-sketchup.rb +53 -53
- data/rubocop-sketchup.gemspec +29 -29
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5efe95e14f04913b090258746992bd4b2c01f50442d32cbca71adb1d861db23
|
4
|
+
data.tar.gz: 6d5d4246f90e0e81f7ed12de2c3f216954b218a5e408541949f932471a5be6fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2950dd8d49ec9e8aacff2dd4db42671f7ab9065f583d4f81ce9741ef2447776bae85078e8287f02563ebe05e039d95e3f709ec0d5694ea34cd78bc22bae56661
|
7
|
+
data.tar.gz: bb12504501498f79135abc5708e0774bd824d7907f162a647fc6ab9a168d8e29630fd26acc501e4d4f0fa1d2743b58c60b2656bbb00beb5b64a439984968e193
|
data/Gemfile
CHANGED
@@ -1,21 +1,20 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
gemspec
|
6
|
-
|
7
|
-
group :test do
|
8
|
-
gem '
|
9
|
-
gem '
|
10
|
-
gem '
|
11
|
-
gem 'rubocop-
|
12
|
-
gem 'rubocop-
|
13
|
-
gem '
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
gem '
|
19
|
-
gem '
|
20
|
-
|
21
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
gemspec
|
6
|
+
|
7
|
+
group :test do
|
8
|
+
gem 'rake', '~> 12.0', require: false
|
9
|
+
gem 'rspec', '~> 3.7', require: false
|
10
|
+
gem 'rubocop-performance', '~> 1.11.0', require: false
|
11
|
+
gem 'rubocop-rake', '~> 0.6.0', require: false
|
12
|
+
gem 'rubocop-rspec', require: false
|
13
|
+
gem 'simplecov', '~> 0.10', require: false
|
14
|
+
end
|
15
|
+
|
16
|
+
group :development do
|
17
|
+
gem 'bump', '~> 0.5', require: false
|
18
|
+
gem 'solargraph', '~> 0.34', require: false
|
19
|
+
gem 'yard', '~> 0.9', require: false
|
20
|
+
end
|
data/assets/output.html.erb
CHANGED
@@ -1,301 +1,301 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset='UTF-8' />
|
5
|
-
<title>SketchUp Extension RuboCop Inspection Report</title>
|
6
|
-
<%# TODO: Clean up the messy markup and style definitions. %>
|
7
|
-
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
|
8
|
-
<style>
|
9
|
-
* {
|
10
|
-
-webkit-box-sizing: border-box;
|
11
|
-
-moz-box-sizing: border-box;
|
12
|
-
box-sizing: border-box;
|
13
|
-
}
|
14
|
-
|
15
|
-
body, html {
|
16
|
-
font-size: 62.5%;
|
17
|
-
}
|
18
|
-
body {
|
19
|
-
background-color: #f3f3f7;
|
20
|
-
color: #363545;
|
21
|
-
font-family: 'Open Sans', sans-serif;
|
22
|
-
margin: 0;
|
23
|
-
}
|
24
|
-
code {
|
25
|
-
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
26
|
-
font-size: 85%;
|
27
|
-
}
|
28
|
-
h1, h2, h3, h4, h5, h6 {
|
29
|
-
font-weight: normal;
|
30
|
-
}
|
31
|
-
a {
|
32
|
-
color: #e72b2d;
|
33
|
-
text-decoration: none;
|
34
|
-
}
|
35
|
-
#header {
|
36
|
-
background: #363545;
|
37
|
-
color: #fff;
|
38
|
-
height: 60px;
|
39
|
-
padding: 0;
|
40
|
-
}
|
41
|
-
#header .logo {
|
42
|
-
float: left;
|
43
|
-
margin: 10px 12px 7px 20px;
|
44
|
-
width: 38px;
|
45
|
-
height: 38px;
|
46
|
-
}
|
47
|
-
#header .title {
|
48
|
-
display: inline-block;
|
49
|
-
float: left;
|
50
|
-
height: 60px;
|
51
|
-
font-size: 2.4rem;
|
52
|
-
letter-spacing: normal;
|
53
|
-
line-height: 60px;
|
54
|
-
margin: 0;
|
55
|
-
}
|
56
|
-
|
57
|
-
.information, #offenses {
|
58
|
-
width: 100%;
|
59
|
-
padding: 20px;
|
60
|
-
color: #333;
|
61
|
-
}
|
62
|
-
#offenses {
|
63
|
-
padding: 0 20px;
|
64
|
-
}
|
65
|
-
|
66
|
-
.information .infobox {
|
67
|
-
border-left: 3px solid;
|
68
|
-
background-color: #fff;
|
69
|
-
padding: 15px;
|
70
|
-
border-color: #e72b2d;
|
71
|
-
font-size: 1.4rem;
|
72
|
-
}
|
73
|
-
.information .infobox .total {
|
74
|
-
font-weight: bold;
|
75
|
-
}
|
76
|
-
.information .infobox .info-title {
|
77
|
-
font-size: 1.8rem;
|
78
|
-
line-height: 2.2rem;
|
79
|
-
margin: 0 0 0.5em;
|
80
|
-
}
|
81
|
-
.information .offenses-list li {
|
82
|
-
line-height: 2.6rem;
|
83
|
-
}
|
84
|
-
.information .offenses-list {
|
85
|
-
padding-left: 20px;
|
86
|
-
margin-bottom: 0;
|
87
|
-
}
|
88
|
-
|
89
|
-
#offenses .offense-box {
|
90
|
-
margin-bottom: 20px;
|
91
|
-
background-color: #fff;
|
92
|
-
}
|
93
|
-
.fixed .box-title {
|
94
|
-
position: fixed;
|
95
|
-
top: 0;
|
96
|
-
z-index: 10;
|
97
|
-
width: 100%;
|
98
|
-
}
|
99
|
-
.box-title-placeholder {
|
100
|
-
display: none;
|
101
|
-
}
|
102
|
-
.fixed .box-title-placeholder {
|
103
|
-
display: block;
|
104
|
-
}
|
105
|
-
#offenses .offense-box .box-title h3, #offenses .offense-box .box-title-placeholder h3 {
|
106
|
-
color: #33353f;
|
107
|
-
background-color: #f6f6f6;
|
108
|
-
font-size: 2rem;
|
109
|
-
line-height: 2rem;
|
110
|
-
display: block;
|
111
|
-
padding: 15px;
|
112
|
-
margin: 0;
|
113
|
-
}
|
114
|
-
#offenses .offense-box .offense-reports {
|
115
|
-
padding: 0 15px;
|
116
|
-
}
|
117
|
-
#offenses .offense-box .offense-reports .report {
|
118
|
-
border-bottom: 1px solid #e2e2e7;
|
119
|
-
padding: 15px 0px;
|
120
|
-
position: relative;
|
121
|
-
font-size: 1.3rem;
|
122
|
-
}
|
123
|
-
#offenses .offense-box .offense-reports .report:last-child {
|
124
|
-
border-bottom: none;
|
125
|
-
}
|
126
|
-
#offenses .offense-box .offense-reports .report pre code {
|
127
|
-
display: block;
|
128
|
-
background: #222;
|
129
|
-
color: #fff;
|
130
|
-
padding: 10px 15px;
|
131
|
-
line-height: 1.6rem;
|
132
|
-
}
|
133
|
-
#offenses .offense-box .offense-reports .report .location {
|
134
|
-
font-weight: bold;
|
135
|
-
}
|
136
|
-
#offenses .offense-box .offense-reports .report .message code {
|
137
|
-
padding: 0.3em;
|
138
|
-
background-color: rgba(0,0,0,0.07);
|
139
|
-
}
|
140
|
-
.severity {
|
141
|
-
text-transform: capitalize;
|
142
|
-
font-weight: bold;
|
143
|
-
}
|
144
|
-
.highlight {
|
145
|
-
padding: 2px;
|
146
|
-
border-radius: 2px;
|
147
|
-
font-weight: bold;
|
148
|
-
}
|
149
|
-
<%- SEVERITY_COLORS.each do |severity, color| %>
|
150
|
-
.severity.<%= severity %> {
|
151
|
-
color: <%= color %>;
|
152
|
-
}
|
153
|
-
.highlight.<%= severity %> {
|
154
|
-
background-color: <%= color.fade_out(0.4) %>;
|
155
|
-
border: 1px solid <%= color.fade_out(0.6) %>;
|
156
|
-
}
|
157
|
-
<%- end %>
|
158
|
-
footer {
|
159
|
-
margin-bottom: 20px;
|
160
|
-
margin-right: 20px;
|
161
|
-
font-size: 1.3rem;
|
162
|
-
color: #777;
|
163
|
-
text-align: right;
|
164
|
-
}
|
165
|
-
.extra-code {
|
166
|
-
color: #ED9C28
|
167
|
-
}
|
168
|
-
hr {
|
169
|
-
border: none;
|
170
|
-
border-top: 3px solid #e2e2e7;
|
171
|
-
margin: 20px 0;
|
172
|
-
}
|
173
|
-
#offenses .offense-box.department {
|
174
|
-
background-color: #f3f3f7;
|
175
|
-
/* border-top: 3px solid #e2e2e7; */
|
176
|
-
}
|
177
|
-
#offenses .offense-box.department .box-title h3,
|
178
|
-
#offenses .offense-box.department .box-title-placeholder h3 {
|
179
|
-
background-color: #f3f3f7;
|
180
|
-
color: #363545;
|
181
|
-
font-weight: bold;
|
182
|
-
}
|
183
|
-
#offenses .offense-box.department .offense-reports .report {
|
184
|
-
padding: 0 0 5px 0;
|
185
|
-
}
|
186
|
-
</style>
|
187
|
-
|
188
|
-
<script>
|
189
|
-
(function() {
|
190
|
-
// floating headers. requires classList support.
|
191
|
-
if (!('classList' in document.createElement("_"))) return;
|
192
|
-
|
193
|
-
var loaded = false,
|
194
|
-
boxes,
|
195
|
-
boxPositions;
|
196
|
-
|
197
|
-
window.onload = function() {
|
198
|
-
var scrollY = window.scrollY;
|
199
|
-
boxes = document.querySelectorAll('.offense-box');
|
200
|
-
boxPositions = [];
|
201
|
-
for (var i = 0; i < boxes.length; i++)
|
202
|
-
// need to add scrollY because the page might be somewhere other than the top when loaded.
|
203
|
-
boxPositions[i] = boxes[i].getBoundingClientRect().top + scrollY;
|
204
|
-
loaded = true;
|
205
|
-
};
|
206
|
-
|
207
|
-
window.onscroll = function() {
|
208
|
-
if (!loaded) return;
|
209
|
-
var i,
|
210
|
-
idx,
|
211
|
-
scrollY = window.scrollY;
|
212
|
-
for (i = 0; i < boxPositions.length; i++) {
|
213
|
-
if (scrollY <= boxPositions[i] - 1) {
|
214
|
-
idx = i;
|
215
|
-
break;
|
216
|
-
}
|
217
|
-
}
|
218
|
-
if (typeof idx == 'undefined') idx = boxes.length;
|
219
|
-
if (idx > 0)
|
220
|
-
boxes[idx - 1].classList.add('fixed');
|
221
|
-
for (i = 0; i < boxes.length; i++) {
|
222
|
-
if (i < idx) continue;
|
223
|
-
boxes[i].classList.remove('fixed');
|
224
|
-
}
|
225
|
-
};
|
226
|
-
})();
|
227
|
-
</script>
|
228
|
-
</head>
|
229
|
-
<body>
|
230
|
-
<div id="header">
|
231
|
-
<img class="logo" src="data:image/png;base64,<%= base64_encoded_logo_image %>" alt="">
|
232
|
-
<h1 class="title">SketchUp Extension RuboCop Inspection Report</h1>
|
233
|
-
</div>
|
234
|
-
<div class="information">
|
235
|
-
<div class="infobox">
|
236
|
-
<div class="total">
|
237
|
-
<%= pluralize(files.count, 'file') %> inspected,
|
238
|
-
<%= pluralize(summary.offense_count, 'offense', no_for_zero: true) %> detected:
|
239
|
-
</div>
|
240
|
-
<ul class="offenses-list">
|
241
|
-
<% categories.each do |category, offenses| %>
|
242
|
-
<li>
|
243
|
-
<a href="#<%= cop_anchor(category) %>">
|
244
|
-
<%= category %> <%= pluralize(offenses.count, 'offense') %>
|
245
|
-
</a>
|
246
|
-
</li>
|
247
|
-
<% end %>
|
248
|
-
</ul>
|
249
|
-
</div>
|
250
|
-
</div>
|
251
|
-
<div id="offenses">
|
252
|
-
<% categories.each do |category, offenses| %>
|
253
|
-
<% if new_department?(category) %>
|
254
|
-
<hr>
|
255
|
-
<div class="offense-box department">
|
256
|
-
<div class="box-title">
|
257
|
-
<h3>
|
258
|
-
<%= department(category) %> -
|
259
|
-
<%= pluralize(department_offense_count(category), 'offense') %>
|
260
|
-
</h3>
|
261
|
-
</div>
|
262
|
-
<div class="offense-reports">
|
263
|
-
<div class="report">
|
264
|
-
<span class="message">
|
265
|
-
<%= department_description(category) %>
|
266
|
-
</span>
|
267
|
-
</div>
|
268
|
-
</div>
|
269
|
-
</div>
|
270
|
-
<% end %>
|
271
|
-
<div class="offense-box" id="<%= cop_anchor(category) %>">
|
272
|
-
<div class="box-title-placeholder"><h3> </h3></div>
|
273
|
-
<div class="box-title"><h3><%= category %> - <%= pluralize(offenses.count, 'offense') %></h3></div>
|
274
|
-
<div class="offense-reports">
|
275
|
-
<% offenses.each do |report| %>
|
276
|
-
<% offense = report.offense %>
|
277
|
-
<div class="report">
|
278
|
-
<div class="meta">
|
279
|
-
<span class="severity <%= offense.severity %>"><%= offense.severity %>:</span>
|
280
|
-
<span class="location">
|
281
|
-
<%= relative_path(report.path) %>:<%= offense.location.line %>
|
282
|
-
</span> –
|
283
|
-
<span class="message"><%= decorated_message(offense) %></span>
|
284
|
-
</div>
|
285
|
-
<% unless offense.location.source_line.strip.empty? %>
|
286
|
-
<pre><code><%= highlighted_source_line(offense) %></code></pre>
|
287
|
-
<% end %>
|
288
|
-
</div>
|
289
|
-
<% end %>
|
290
|
-
</div>
|
291
|
-
</div>
|
292
|
-
<% end %>
|
293
|
-
</div>
|
294
|
-
<footer>
|
295
|
-
Generated by <a href="https://github.com/rubocop-hq/rubocop">RuboCop</a>
|
296
|
-
<span class="version"><%= RuboCop::Version::STRING %></span> -
|
297
|
-
<a href="https://github.com/SketchUp/rubocop-sketchup">RuboCop SketchUp</a>
|
298
|
-
<span class="version"><%= RuboCop::SketchUp::VERSION %></span>
|
299
|
-
</footer>
|
300
|
-
</body>
|
301
|
-
</html>
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset='UTF-8' />
|
5
|
+
<title>SketchUp Extension RuboCop Inspection Report</title>
|
6
|
+
<%# TODO: Clean up the messy markup and style definitions. %>
|
7
|
+
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
|
8
|
+
<style>
|
9
|
+
* {
|
10
|
+
-webkit-box-sizing: border-box;
|
11
|
+
-moz-box-sizing: border-box;
|
12
|
+
box-sizing: border-box;
|
13
|
+
}
|
14
|
+
|
15
|
+
body, html {
|
16
|
+
font-size: 62.5%;
|
17
|
+
}
|
18
|
+
body {
|
19
|
+
background-color: #f3f3f7;
|
20
|
+
color: #363545;
|
21
|
+
font-family: 'Open Sans', sans-serif;
|
22
|
+
margin: 0;
|
23
|
+
}
|
24
|
+
code {
|
25
|
+
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
26
|
+
font-size: 85%;
|
27
|
+
}
|
28
|
+
h1, h2, h3, h4, h5, h6 {
|
29
|
+
font-weight: normal;
|
30
|
+
}
|
31
|
+
a {
|
32
|
+
color: #e72b2d;
|
33
|
+
text-decoration: none;
|
34
|
+
}
|
35
|
+
#header {
|
36
|
+
background: #363545;
|
37
|
+
color: #fff;
|
38
|
+
height: 60px;
|
39
|
+
padding: 0;
|
40
|
+
}
|
41
|
+
#header .logo {
|
42
|
+
float: left;
|
43
|
+
margin: 10px 12px 7px 20px;
|
44
|
+
width: 38px;
|
45
|
+
height: 38px;
|
46
|
+
}
|
47
|
+
#header .title {
|
48
|
+
display: inline-block;
|
49
|
+
float: left;
|
50
|
+
height: 60px;
|
51
|
+
font-size: 2.4rem;
|
52
|
+
letter-spacing: normal;
|
53
|
+
line-height: 60px;
|
54
|
+
margin: 0;
|
55
|
+
}
|
56
|
+
|
57
|
+
.information, #offenses {
|
58
|
+
width: 100%;
|
59
|
+
padding: 20px;
|
60
|
+
color: #333;
|
61
|
+
}
|
62
|
+
#offenses {
|
63
|
+
padding: 0 20px;
|
64
|
+
}
|
65
|
+
|
66
|
+
.information .infobox {
|
67
|
+
border-left: 3px solid;
|
68
|
+
background-color: #fff;
|
69
|
+
padding: 15px;
|
70
|
+
border-color: #e72b2d;
|
71
|
+
font-size: 1.4rem;
|
72
|
+
}
|
73
|
+
.information .infobox .total {
|
74
|
+
font-weight: bold;
|
75
|
+
}
|
76
|
+
.information .infobox .info-title {
|
77
|
+
font-size: 1.8rem;
|
78
|
+
line-height: 2.2rem;
|
79
|
+
margin: 0 0 0.5em;
|
80
|
+
}
|
81
|
+
.information .offenses-list li {
|
82
|
+
line-height: 2.6rem;
|
83
|
+
}
|
84
|
+
.information .offenses-list {
|
85
|
+
padding-left: 20px;
|
86
|
+
margin-bottom: 0;
|
87
|
+
}
|
88
|
+
|
89
|
+
#offenses .offense-box {
|
90
|
+
margin-bottom: 20px;
|
91
|
+
background-color: #fff;
|
92
|
+
}
|
93
|
+
.fixed .box-title {
|
94
|
+
position: fixed;
|
95
|
+
top: 0;
|
96
|
+
z-index: 10;
|
97
|
+
width: 100%;
|
98
|
+
}
|
99
|
+
.box-title-placeholder {
|
100
|
+
display: none;
|
101
|
+
}
|
102
|
+
.fixed .box-title-placeholder {
|
103
|
+
display: block;
|
104
|
+
}
|
105
|
+
#offenses .offense-box .box-title h3, #offenses .offense-box .box-title-placeholder h3 {
|
106
|
+
color: #33353f;
|
107
|
+
background-color: #f6f6f6;
|
108
|
+
font-size: 2rem;
|
109
|
+
line-height: 2rem;
|
110
|
+
display: block;
|
111
|
+
padding: 15px;
|
112
|
+
margin: 0;
|
113
|
+
}
|
114
|
+
#offenses .offense-box .offense-reports {
|
115
|
+
padding: 0 15px;
|
116
|
+
}
|
117
|
+
#offenses .offense-box .offense-reports .report {
|
118
|
+
border-bottom: 1px solid #e2e2e7;
|
119
|
+
padding: 15px 0px;
|
120
|
+
position: relative;
|
121
|
+
font-size: 1.3rem;
|
122
|
+
}
|
123
|
+
#offenses .offense-box .offense-reports .report:last-child {
|
124
|
+
border-bottom: none;
|
125
|
+
}
|
126
|
+
#offenses .offense-box .offense-reports .report pre code {
|
127
|
+
display: block;
|
128
|
+
background: #222;
|
129
|
+
color: #fff;
|
130
|
+
padding: 10px 15px;
|
131
|
+
line-height: 1.6rem;
|
132
|
+
}
|
133
|
+
#offenses .offense-box .offense-reports .report .location {
|
134
|
+
font-weight: bold;
|
135
|
+
}
|
136
|
+
#offenses .offense-box .offense-reports .report .message code {
|
137
|
+
padding: 0.3em;
|
138
|
+
background-color: rgba(0,0,0,0.07);
|
139
|
+
}
|
140
|
+
.severity {
|
141
|
+
text-transform: capitalize;
|
142
|
+
font-weight: bold;
|
143
|
+
}
|
144
|
+
.highlight {
|
145
|
+
padding: 2px;
|
146
|
+
border-radius: 2px;
|
147
|
+
font-weight: bold;
|
148
|
+
}
|
149
|
+
<%- SEVERITY_COLORS.each do |severity, color| %>
|
150
|
+
.severity.<%= severity %> {
|
151
|
+
color: <%= color %>;
|
152
|
+
}
|
153
|
+
.highlight.<%= severity %> {
|
154
|
+
background-color: <%= color.fade_out(0.4) %>;
|
155
|
+
border: 1px solid <%= color.fade_out(0.6) %>;
|
156
|
+
}
|
157
|
+
<%- end %>
|
158
|
+
footer {
|
159
|
+
margin-bottom: 20px;
|
160
|
+
margin-right: 20px;
|
161
|
+
font-size: 1.3rem;
|
162
|
+
color: #777;
|
163
|
+
text-align: right;
|
164
|
+
}
|
165
|
+
.extra-code {
|
166
|
+
color: #ED9C28
|
167
|
+
}
|
168
|
+
hr {
|
169
|
+
border: none;
|
170
|
+
border-top: 3px solid #e2e2e7;
|
171
|
+
margin: 20px 0;
|
172
|
+
}
|
173
|
+
#offenses .offense-box.department {
|
174
|
+
background-color: #f3f3f7;
|
175
|
+
/* border-top: 3px solid #e2e2e7; */
|
176
|
+
}
|
177
|
+
#offenses .offense-box.department .box-title h3,
|
178
|
+
#offenses .offense-box.department .box-title-placeholder h3 {
|
179
|
+
background-color: #f3f3f7;
|
180
|
+
color: #363545;
|
181
|
+
font-weight: bold;
|
182
|
+
}
|
183
|
+
#offenses .offense-box.department .offense-reports .report {
|
184
|
+
padding: 0 0 5px 0;
|
185
|
+
}
|
186
|
+
</style>
|
187
|
+
|
188
|
+
<script>
|
189
|
+
(function() {
|
190
|
+
// floating headers. requires classList support.
|
191
|
+
if (!('classList' in document.createElement("_"))) return;
|
192
|
+
|
193
|
+
var loaded = false,
|
194
|
+
boxes,
|
195
|
+
boxPositions;
|
196
|
+
|
197
|
+
window.onload = function() {
|
198
|
+
var scrollY = window.scrollY;
|
199
|
+
boxes = document.querySelectorAll('.offense-box');
|
200
|
+
boxPositions = [];
|
201
|
+
for (var i = 0; i < boxes.length; i++)
|
202
|
+
// need to add scrollY because the page might be somewhere other than the top when loaded.
|
203
|
+
boxPositions[i] = boxes[i].getBoundingClientRect().top + scrollY;
|
204
|
+
loaded = true;
|
205
|
+
};
|
206
|
+
|
207
|
+
window.onscroll = function() {
|
208
|
+
if (!loaded) return;
|
209
|
+
var i,
|
210
|
+
idx,
|
211
|
+
scrollY = window.scrollY;
|
212
|
+
for (i = 0; i < boxPositions.length; i++) {
|
213
|
+
if (scrollY <= boxPositions[i] - 1) {
|
214
|
+
idx = i;
|
215
|
+
break;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
if (typeof idx == 'undefined') idx = boxes.length;
|
219
|
+
if (idx > 0)
|
220
|
+
boxes[idx - 1].classList.add('fixed');
|
221
|
+
for (i = 0; i < boxes.length; i++) {
|
222
|
+
if (i < idx) continue;
|
223
|
+
boxes[i].classList.remove('fixed');
|
224
|
+
}
|
225
|
+
};
|
226
|
+
})();
|
227
|
+
</script>
|
228
|
+
</head>
|
229
|
+
<body>
|
230
|
+
<div id="header">
|
231
|
+
<img class="logo" src="data:image/png;base64,<%= base64_encoded_logo_image %>" alt="">
|
232
|
+
<h1 class="title">SketchUp Extension RuboCop Inspection Report</h1>
|
233
|
+
</div>
|
234
|
+
<div class="information">
|
235
|
+
<div class="infobox">
|
236
|
+
<div class="total">
|
237
|
+
<%= pluralize(files.count, 'file') %> inspected,
|
238
|
+
<%= pluralize(summary.offense_count, 'offense', no_for_zero: true) %> detected:
|
239
|
+
</div>
|
240
|
+
<ul class="offenses-list">
|
241
|
+
<% categories.each do |category, offenses| %>
|
242
|
+
<li>
|
243
|
+
<a href="#<%= cop_anchor(category) %>">
|
244
|
+
<%= category %> <%= pluralize(offenses.count, 'offense') %>
|
245
|
+
</a>
|
246
|
+
</li>
|
247
|
+
<% end %>
|
248
|
+
</ul>
|
249
|
+
</div>
|
250
|
+
</div>
|
251
|
+
<div id="offenses">
|
252
|
+
<% categories.each do |category, offenses| %>
|
253
|
+
<% if new_department?(category) %>
|
254
|
+
<hr>
|
255
|
+
<div class="offense-box department">
|
256
|
+
<div class="box-title">
|
257
|
+
<h3>
|
258
|
+
<%= department(category) %> -
|
259
|
+
<%= pluralize(department_offense_count(category), 'offense') %>
|
260
|
+
</h3>
|
261
|
+
</div>
|
262
|
+
<div class="offense-reports">
|
263
|
+
<div class="report">
|
264
|
+
<span class="message">
|
265
|
+
<%= department_description(category) %>
|
266
|
+
</span>
|
267
|
+
</div>
|
268
|
+
</div>
|
269
|
+
</div>
|
270
|
+
<% end %>
|
271
|
+
<div class="offense-box" id="<%= cop_anchor(category) %>">
|
272
|
+
<div class="box-title-placeholder"><h3> </h3></div>
|
273
|
+
<div class="box-title"><h3><%= category %> - <%= pluralize(offenses.count, 'offense') %></h3></div>
|
274
|
+
<div class="offense-reports">
|
275
|
+
<% offenses.each do |report| %>
|
276
|
+
<% offense = report.offense %>
|
277
|
+
<div class="report">
|
278
|
+
<div class="meta">
|
279
|
+
<span class="severity <%= offense.severity %>"><%= offense.severity %>:</span>
|
280
|
+
<span class="location">
|
281
|
+
<%= relative_path(report.path) %>:<%= offense.location.line %>
|
282
|
+
</span> –
|
283
|
+
<span class="message"><%= decorated_message(offense) %></span>
|
284
|
+
</div>
|
285
|
+
<% unless offense.location.source_line.strip.empty? %>
|
286
|
+
<pre><code><%= highlighted_source_line(offense) %></code></pre>
|
287
|
+
<% end %>
|
288
|
+
</div>
|
289
|
+
<% end %>
|
290
|
+
</div>
|
291
|
+
</div>
|
292
|
+
<% end %>
|
293
|
+
</div>
|
294
|
+
<footer>
|
295
|
+
Generated by <a href="https://github.com/rubocop-hq/rubocop">RuboCop</a>
|
296
|
+
<span class="version"><%= RuboCop::Version::STRING %></span> -
|
297
|
+
<a href="https://github.com/SketchUp/rubocop-sketchup">RuboCop SketchUp</a>
|
298
|
+
<span class="version"><%= RuboCop::SketchUp::VERSION %></span>
|
299
|
+
</footer>
|
300
|
+
</body>
|
301
|
+
</html>
|