rubocop-sketchup 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +20 -19
  3. data/assets/output.html.erb +301 -301
  4. data/config/default.yml +379 -355
  5. data/lib/rubocop-sketchup.rb +49 -48
  6. data/lib/rubocop/sketchup.rb +12 -12
  7. data/lib/rubocop/sketchup/config.rb +63 -63
  8. data/lib/rubocop/sketchup/cop.rb +111 -111
  9. data/lib/rubocop/sketchup/cop/bugs/material_name.rb +108 -0
  10. data/lib/rubocop/sketchup/cop/bugs/render_mode.rb +72 -0
  11. data/lib/rubocop/sketchup/cop/bugs/uniform_scaling.rb +36 -0
  12. data/lib/rubocop/sketchup/cop/deprecations/add_separator_to_menu.rb +25 -25
  13. data/lib/rubocop/sketchup/cop/deprecations/operation_next_transparent.rb +30 -30
  14. data/lib/rubocop/sketchup/cop/deprecations/require_all.rb +27 -27
  15. data/lib/rubocop/sketchup/cop/deprecations/set_texture_projection.rb +26 -26
  16. data/lib/rubocop/sketchup/cop/deprecations/show_ruby_panel.rb +25 -25
  17. data/lib/rubocop/sketchup/cop/deprecations/sketchup_set.rb +30 -30
  18. data/lib/rubocop/sketchup/cop/performance/openssl.rb +41 -41
  19. data/lib/rubocop/sketchup/cop/performance/operation_disable_ui.rb +33 -33
  20. data/lib/rubocop/sketchup/cop/performance/selection_bulk.rb +79 -79
  21. data/lib/rubocop/sketchup/cop/performance/type_check.rb +63 -63
  22. data/lib/rubocop/sketchup/cop/performance/typename.rb +24 -24
  23. data/lib/rubocop/sketchup/cop/requirements/api_namespace.rb +30 -30
  24. data/lib/rubocop/sketchup/cop/requirements/exit.rb +32 -32
  25. data/lib/rubocop/sketchup/cop/requirements/extension_namespace.rb +108 -108
  26. data/lib/rubocop/sketchup/cop/requirements/file_structure.rb +97 -97
  27. data/lib/rubocop/sketchup/cop/requirements/gem_install.rb +45 -45
  28. data/lib/rubocop/sketchup/cop/requirements/get_extension_license.rb +95 -95
  29. data/lib/rubocop/sketchup/cop/requirements/global_constants.rb +38 -38
  30. data/lib/rubocop/sketchup/cop/requirements/global_include.rb +42 -42
  31. data/lib/rubocop/sketchup/cop/requirements/global_methods.rb +65 -65
  32. data/lib/rubocop/sketchup/cop/requirements/global_variables.rb +95 -95
  33. data/lib/rubocop/sketchup/cop/requirements/language_handler_globals.rb +46 -46
  34. data/lib/rubocop/sketchup/cop/requirements/load_path.rb +83 -83
  35. data/lib/rubocop/sketchup/cop/requirements/minimal_registration.rb +73 -73
  36. data/lib/rubocop/sketchup/cop/requirements/observers_start_operation.rb +161 -161
  37. data/lib/rubocop/sketchup/cop/requirements/register_extension.rb +45 -45
  38. data/lib/rubocop/sketchup/cop/requirements/ruby_core_namespace.rb +291 -291
  39. data/lib/rubocop/sketchup/cop/requirements/ruby_stdlib_namespace.rb +634 -634
  40. data/lib/rubocop/sketchup/cop/requirements/shipped_extensions_namespace.rb +61 -61
  41. data/lib/rubocop/sketchup/cop/requirements/sketchup_extension.rb +119 -119
  42. data/lib/rubocop/sketchup/cop/requirements/sketchup_require.rb +163 -163
  43. data/lib/rubocop/sketchup/cop/suggestions/add_group.rb +49 -49
  44. data/lib/rubocop/sketchup/cop/suggestions/compatibility.rb +121 -117
  45. data/lib/rubocop/sketchup/cop/suggestions/dc_internals.rb +34 -34
  46. data/lib/rubocop/sketchup/cop/suggestions/file_encoding.rb +78 -78
  47. data/lib/rubocop/sketchup/cop/suggestions/model_entities.rb +58 -58
  48. data/lib/rubocop/sketchup/cop/suggestions/monkey_patched_api.rb +45 -45
  49. data/lib/rubocop/sketchup/cop/suggestions/operation_name.rb +137 -103
  50. data/lib/rubocop/sketchup/cop/suggestions/sketchup_find_support_file.rb +39 -39
  51. data/lib/rubocop/sketchup/cop/suggestions/tool_drawing_bounds.rb +44 -44
  52. data/lib/rubocop/sketchup/cop/suggestions/tool_invalidate.rb +66 -66
  53. data/lib/rubocop/sketchup/cop/suggestions/tool_user_input.rb +41 -41
  54. data/lib/rubocop/sketchup/cop/suggestions/toolbar_timer.rb +65 -65
  55. data/lib/rubocop/sketchup/dc_globals.rb +24 -24
  56. data/lib/rubocop/sketchup/dc_methods.rb +130 -130
  57. data/lib/rubocop/sketchup/extension_project.rb +65 -65
  58. data/lib/rubocop/sketchup/features.rb +738 -738
  59. data/lib/rubocop/sketchup/formatter/extension_review.rb +269 -259
  60. data/lib/rubocop/sketchup/inject.rb +19 -19
  61. data/lib/rubocop/sketchup/namespace.rb +47 -47
  62. data/lib/rubocop/sketchup/namespace_checker.rb +46 -46
  63. data/lib/rubocop/sketchup/no_comment_disable.rb +17 -17
  64. data/lib/rubocop/sketchup/range_help.rb +52 -52
  65. data/lib/rubocop/sketchup/sketchup_target_range.rb +75 -0
  66. data/lib/rubocop/sketchup/sketchup_version.rb +117 -87
  67. data/lib/rubocop/sketchup/tool_checker.rb +43 -43
  68. data/lib/rubocop/sketchup/version.rb +5 -5
  69. data/rubocop-sketchup.gemspec +27 -27
  70. metadata +8 -4
@@ -1,355 +1,379 @@
1
- # Common configuration.
2
-
3
- AllCops:
4
- SketchUp:
5
- # The path to the extension source. This needs to be correct in order to
6
- # correctly validate file structure.
7
- SourcePath: src
8
- # Set target SketchUp version. Compatibility checks can then warn if you
9
- # use features that belong to older SketchUp versions. Refer to the manual
10
- # for list of valid versions.
11
- TargetSketchUpVersion: 2016
12
- # Indicate if you plan to scramble/encrypt this extension using the .RBS or
13
- # .RBE format. It changes the technical requirements for requiring files.
14
- EncryptedExtension: false
15
- # Binary Ruby C Extension must always be loaded using Ruby's own `require`.
16
- # If you enable `AllCops/SketchUp/EncryptedExtension` you need to list
17
- # the require paths for your Ruby C Extensions if you have any.
18
- ExtensionBinaries: []
19
- # You can set up exclude pattens for all SketchUp departments.
20
- Exclude: []
21
- # Alternativly you can set up department wide exclusion.
22
- SketchupDeprecations:
23
- Exclude: []
24
- SketchupPerformance:
25
- Exclude: []
26
- SketchupRequirements:
27
- Exclude: []
28
- SketchupSuggestions:
29
- Exclude: []
30
-
31
-
32
- SketchupDeprecations/AddSeparatorToMenu:
33
- Description: The method `add_separator_to_menu` is deprecated.
34
- Details: >-
35
- Avoid adding separators to top level menus. If you require
36
- grouping use a sub-menu instead.
37
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_deprecations.md#addseparatortomenu
38
- Enabled: true
39
-
40
- SketchupDeprecations/OperationNextTransparent:
41
- Description: Third argument in `model.start_operation` is deprecated.
42
- Details: >-
43
- It is not possible to predict what operation will come next. Avoid
44
- making the next operation transparent.
45
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_deprecations.md#operationnexttransparent
46
- Enabled: true
47
-
48
- SketchupDeprecations/RequireAll:
49
- Description: The method `require_all` is deprecated.
50
- Details: >-
51
- This method adds the path given to `$LOAD_PATH` which can affect
52
- other extensions.
53
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_deprecations.md#requireall
54
- Enabled: true
55
-
56
- SketchupDeprecations/SetTextureProjection:
57
- Description: The method `Sketchup::Face#set_texture_projection` is deprecated.
58
- Details: >-
59
- This method never worked right. It's not possible to control the
60
- position and orientation of the texture.
61
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_deprecations.md#settextureprojection
62
- Enabled: true
63
-
64
- SketchupDeprecations/ShowRubyPanel:
65
- Description: The method `show_ruby_panel` is deprecated.
66
- Details: Use `SKETCHUP_CONSOLE.show` instead.
67
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_deprecations.md#showrubypanel
68
- Enabled: true
69
-
70
- SketchupDeprecations/SketchupSet:
71
- Description: The class `Sketchup::Set` is deprecated.
72
- Details: >-
73
- It's slow and with limited functionality. Use the `Set` class in
74
- the Ruby StdLib instead.
75
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_deprecations.md#sketchupset
76
- Enabled: true
77
-
78
-
79
- SketchupPerformance/OpenSSL:
80
- Description: Avoid using Ruby's OpenSSL within SketchUp.
81
- Details: >-
82
- A flaw in how it obtain random bits under Windows can severely
83
- affect performance, freezing SketchUp for many minutes. This also
84
- affects SecureRandom and anything else that depend on OpenSSL.
85
- Net::HTTP is affected if connecting via HTTPS. Connecting via
86
- plain HTTP is unaffected.
87
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_performance.md#openssl
88
- Enabled: true
89
-
90
- SketchupPerformance/OperationDisableUI:
91
- Description: Operations should disable the UI for performance gain.
92
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_performance.md#operationdisableui
93
- Enabled: true
94
-
95
- SketchupPerformance/SelectionBulkChanges:
96
- Description: >-
97
- Avoid modifying the selection set within loops. It's much
98
- faster to change the selection in bulk.
99
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_performance.md#selectionbulkchanges
100
- Enabled: true
101
-
102
- SketchupPerformance/TypeCheck:
103
- Description: String comparisons for type checks are very slow.
104
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_performance.md#typecheck
105
- Enabled: true
106
-
107
- SketchupPerformance/Typename:
108
- Description: Using `.typename` is very slow, prefer `.is_a?` instead.
109
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_performance.md#typename
110
- Enabled: true
111
-
112
-
113
- SketchupRequirements/ApiNamespace:
114
- Description: Don't modify the SketchUp API namespace.
115
- Details: >-
116
- Modifying the API namespace could affect other extensions - making
117
- it hard for other developers to determine what is going on.
118
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#apinamespace
119
- Enabled: true
120
-
121
- SketchupRequirements/Exit:
122
- Description: Exit attempts to kill the Ruby interpreter.
123
- Details: >-
124
- SketchUp will trap `exit` and prevent that, with a message in the
125
- console. But `exit!` is not trapped and with terminate SketchUp
126
- without shutting down cleanly. Use `return`, `next` or `break`
127
- instead.
128
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#exit
129
- Enabled: true
130
-
131
- SketchupRequirements/ExtensionNamespace:
132
- Description: Confine extensions to a single root namespace.
133
- Details: >-
134
- To avoid clashing with other extensions a single root namespace
135
- should all the extension's code.
136
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#extensionnamespace
137
- Exceptions: []
138
- Enabled: true
139
-
140
- SketchupRequirements/FileStructure:
141
- Description: Expected extension file structure not found.
142
- Details: >-
143
- Check that the extension conform to expected file structure with a
144
- single root .rb file and a support folder with matching name.
145
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#filestructure
146
- Enabled: true
147
-
148
- SketchupRequirements/GemInstall:
149
- Description: >-
150
- Gem.install is unreliable in SketchUp, and can cause
151
- extensions to clash.
152
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#geminstall
153
- Enabled: true
154
-
155
- SketchupRequirements/GetExtensionLicense:
156
- Description: Pass in valid extension ID from local string literals.
157
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#getextensionlicense
158
- Enabled: true
159
-
160
- SketchupRequirements/GlobalConstants:
161
- Description: Do not introduce global constants.
162
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#globalconstants
163
- Enabled: true
164
-
165
- SketchupRequirements/GlobalInclude:
166
- Description: Do not include modules into global namespace.
167
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#globalinclude
168
- Enabled: true
169
-
170
- SketchupRequirements/GlobalMethods:
171
- Description: Extensions should not define global methods.
172
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#globalmethods
173
- Enabled: true
174
-
175
- SketchupRequirements/GlobalVariables:
176
- Description: Do not introduce global variables.
177
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#globalvariables
178
- Enabled: true
179
-
180
- SketchupRequirements/LanguageHandlerGlobals:
181
- Description: Don't use other known global variables.
182
- Details: >-
183
- Avoid using globals in general, but especially these which are
184
- known to be in use by other extensions made by SketchUp. They are
185
- still in use due to compatibility reasons.
186
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#languagehandlerglobals
187
- Enabled: true
188
-
189
- SketchupRequirements/LoadPath:
190
- Description: Do not modify the load path.
191
- Details: >-
192
- This can cause other extensions from not loading correctly. Always
193
- load files relative to the installation path for the extension.
194
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#loadpath
195
- Enabled: true
196
-
197
- SketchupRequirements/MinimalRegistration:
198
- Description: >-
199
- Don't load extension files in the root file registering the
200
- extension. Extensions should not load additional files when
201
- it's disabled.
202
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#minimalregistration
203
- Enabled: true
204
-
205
- SketchupRequirements/ObserversStartOperation:
206
- Description: Observers should create transparent operations.
207
- Details: >-
208
- When making model changes within an observer event, start a
209
- transparent operation to ensure a clean undo-stack.
210
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#observersstartoperation
211
- Enabled: true
212
-
213
- SketchupRequirements/RegisterExtension:
214
- Description: >-
215
- Always register extensions to load by default. Otherwise it
216
- might confuse users to think the extension isn't working.
217
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#registerextension
218
- Enabled: true
219
-
220
- SketchupRequirements/RequireToolsRubyFiles:
221
- Description: >-
222
- Due to how require and Sketchup.require checks whether a file
223
- has been loaded, files from SketchUp's Tools folder should be
224
- required in using `require` and with their file extension to
225
- avoid duplicate loading.
226
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#requiretoolsrubyfiles
227
- Enabled: true
228
-
229
- SketchupRequirements/RubyCoreNamespace:
230
- Description: Do not modify Ruby core functionality.
231
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#rubycorenamespace
232
- Enabled: true
233
-
234
- SketchupRequirements/RubyStdLibNamespace:
235
- Description: Do not modify Ruby stdlib functionality.
236
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#rubystdlibnamespace
237
- Enabled: true
238
-
239
- SketchupRequirements/SketchupRequire:
240
- Description: >-
241
- Omit file extensions when using `Sketchup.require` to allow
242
- encrypted files to be loaded.
243
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#sketchuprequire
244
- Enabled: true
245
-
246
- SketchupRequirements/ShippedExtensionsNamespace:
247
- Description: Don't use the namespace of SketchUp's shipped extensions.
248
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#shippedextensionsnamespace
249
- Enabled: true
250
-
251
- SketchupRequirements/SketchupExtension:
252
- Description: >-
253
- Register a single instance of SketchupExtension per extension.
254
- This should be done by the root .rb file in the extension
255
- package.
256
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#sketchupextension
257
- Enabled: true
258
-
259
-
260
- SketchupSuggestions/AddGroup:
261
- Description: Avoid creating groups out of existing entities.
262
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#addgroup
263
- Enabled: true
264
-
265
- SketchupSuggestions/Compatibility:
266
- Description: Incompatible feature with target SketchUp version.
267
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#compatibility
268
- Enabled: true
269
-
270
- SketchupSuggestions/DynamicComponentInternals:
271
- Description: >-
272
- Avoid relying on internal logic of Dynamic Components. It's
273
- behavior might change between versions.
274
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#dynamiccomponentinternals
275
- Enabled: true
276
-
277
- SketchupSuggestions/FileEncoding:
278
- Description: Beware encoding bug in Ruby when using `__FILE__` and `__dir__`.
279
- Details: >-
280
- When using `__FILE__` and `__dir__`, beware that Ruby doesn't
281
- apply the correct encoding to the strings under Windows. When they
282
- contain non-english characters it will lead to exceptions being
283
- raised when the strings are used. Force encoding to work around
284
- this.
285
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#fileencoding
286
- Enabled: true
287
-
288
- SketchupSuggestions/ModelEntities:
289
- Description: >-
290
- Typically one should use `model.active_entities` instead of
291
- `model.entities`.
292
- Details: >-
293
- In SketchUp the norm is that editing is performed in the opened
294
- instance (`model.active_entities`). `model.entities` refer to the
295
- model root.
296
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#modelentities
297
- Enabled: true
298
-
299
- SketchupSuggestions/MonkeyPatchedApi:
300
- Description: >-
301
- Avoid using monkey-patched methods from SketchUp's shipped
302
- extensions.
303
- Details: >-
304
- These methods stops working when the extensions are disabled and
305
- may change or be removed.
306
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#monkeypatchedapi
307
- Enabled: true
308
-
309
- SketchupSuggestions/OperationName:
310
- Description: >-
311
- Check that operation names are human friendly and consistent
312
- with SketchUp.
313
- Details: >-
314
- This check is very naive and might produce false positives. Use as
315
- guidance only.
316
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#operationname
317
- Max: 25
318
- Enabled: true
319
-
320
- SketchupSuggestions/SketchupFindSupportFile:
321
- Description: >-
322
- Avoid `Sketchup.find_support_file` to find your extension's
323
- files.
324
- Details: >-
325
- Extensions might be installed outside the SketchUp Plugins folder.
326
- Use `__FILE__` and `__dir__` to locate your files relative to the
327
- executing file.
328
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#sketchupfindsupportfile
329
- Enabled: true
330
-
331
- SketchupSuggestions/ToolDrawingBounds:
332
- Description: >-
333
- When drawing to the viewport implement `getExtents` so drawn
334
- geometry is not clipped.
335
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#tooldrawingbounds
336
- Enabled: true
337
-
338
- SketchupSuggestions/ToolInvalidate:
339
- Description: >-
340
- When drawing to the viewport, make sure tools invalidate when
341
- tool becomes inactive.
342
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#toolinvalidate
343
- Enabled: true
344
-
345
- SketchupSuggestions/ToolUserInput:
346
- Description: >-
347
- When a tool is accepting user input, make sure to define
348
- enableVCB?.
349
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#tooluserinput
350
- Enabled: true
351
-
352
- SketchupSuggestions/ToolbarTimer:
353
- Description: Wrapping `toolbar.restore` in `UI.start_timer` is redundant.
354
- Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#toolbartimer
355
- Enabled: true
1
+ # Common configuration.
2
+
3
+ AllCops:
4
+ SketchUp:
5
+ # The path to the extension source. This needs to be correct in order to
6
+ # correctly validate file structure.
7
+ SourcePath: src
8
+ # Set target SketchUp version. Compatibility checks can then warn if you
9
+ # use features that belong to older SketchUp versions. Refer to the manual
10
+ # for list of valid versions.
11
+ TargetSketchUpVersion: 2016
12
+ # Indicate if you plan to scramble/encrypt this extension using the .RBS or
13
+ # .RBE format. It changes the technical requirements for requiring files.
14
+ EncryptedExtension: false
15
+ # Binary Ruby C Extension must always be loaded using Ruby's own `require`.
16
+ # If you enable `AllCops/SketchUp/EncryptedExtension` you need to list
17
+ # the require paths for your Ruby C Extensions if you have any.
18
+ ExtensionBinaries: []
19
+ # You can set up exclude pattens for all SketchUp departments.
20
+ Exclude: []
21
+ # Alternativly you can set up department wide exclusion.
22
+ SketchupBugs:
23
+ Exclude: []
24
+ SketchupDeprecations:
25
+ Exclude: []
26
+ SketchupPerformance:
27
+ Exclude: []
28
+ SketchupRequirements:
29
+ Exclude: []
30
+ SketchupSuggestions:
31
+ Exclude: []
32
+
33
+
34
+ SketchupBugs/MaterialName:
35
+ Description: >-
36
+ SketchUp 2017 did not protect against the Ruby API creating
37
+ duplicated material names.
38
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_bugs.md#materialname
39
+ Enabled: true
40
+
41
+ SketchupBugs/RenderMode:
42
+ Description: >-
43
+ Invalid rendering mode will crash SketchUp 2017 and newer
44
+ versions.
45
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_bugs.md#rendermode
46
+ Enabled: true
47
+
48
+ SketchupBugs/UniformScaling:
49
+ Description: >-
50
+ `Geom::Transformation.scaling(scale)` might yield unexpected
51
+ behavior.
52
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_bugs.md#uniformscaling
53
+ Enabled: true
54
+
55
+
56
+ SketchupDeprecations/AddSeparatorToMenu:
57
+ Description: The method `add_separator_to_menu` is deprecated.
58
+ Details: >-
59
+ Avoid adding separators to top level menus. If you require
60
+ grouping use a sub-menu instead.
61
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_deprecations.md#addseparatortomenu
62
+ Enabled: true
63
+
64
+ SketchupDeprecations/OperationNextTransparent:
65
+ Description: Third argument in `model.start_operation` is deprecated.
66
+ Details: >-
67
+ It is not possible to predict what operation will come next. Avoid
68
+ making the next operation transparent.
69
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_deprecations.md#operationnexttransparent
70
+ Enabled: true
71
+
72
+ SketchupDeprecations/RequireAll:
73
+ Description: The method `require_all` is deprecated.
74
+ Details: >-
75
+ This method adds the path given to `$LOAD_PATH` which can affect
76
+ other extensions.
77
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_deprecations.md#requireall
78
+ Enabled: true
79
+
80
+ SketchupDeprecations/SetTextureProjection:
81
+ Description: The method `Sketchup::Face#set_texture_projection` is deprecated.
82
+ Details: >-
83
+ This method never worked right. It's not possible to control the
84
+ position and orientation of the texture.
85
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_deprecations.md#settextureprojection
86
+ Enabled: true
87
+
88
+ SketchupDeprecations/ShowRubyPanel:
89
+ Description: The method `show_ruby_panel` is deprecated.
90
+ Details: Use `SKETCHUP_CONSOLE.show` instead.
91
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_deprecations.md#showrubypanel
92
+ Enabled: true
93
+
94
+ SketchupDeprecations/SketchupSet:
95
+ Description: The class `Sketchup::Set` is deprecated.
96
+ Details: >-
97
+ It's slow and with limited functionality. Use the `Set` class in
98
+ the Ruby StdLib instead.
99
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_deprecations.md#sketchupset
100
+ Enabled: true
101
+
102
+
103
+ SketchupPerformance/OpenSSL:
104
+ Description: Avoid using Ruby's OpenSSL within SketchUp.
105
+ Details: >-
106
+ A flaw in how it obtain random bits under Windows can severely
107
+ affect performance, freezing SketchUp for many minutes. This also
108
+ affects SecureRandom and anything else that depend on OpenSSL.
109
+ Net::HTTP is affected if connecting via HTTPS. Connecting via
110
+ plain HTTP is unaffected.
111
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_performance.md#openssl
112
+ Enabled: true
113
+
114
+ SketchupPerformance/OperationDisableUI:
115
+ Description: Operations should disable the UI for performance gain.
116
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_performance.md#operationdisableui
117
+ Enabled: true
118
+
119
+ SketchupPerformance/SelectionBulkChanges:
120
+ Description: >-
121
+ Avoid modifying the selection set within loops. It's much
122
+ faster to change the selection in bulk.
123
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_performance.md#selectionbulkchanges
124
+ Enabled: true
125
+
126
+ SketchupPerformance/TypeCheck:
127
+ Description: String comparisons for type checks are very slow.
128
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_performance.md#typecheck
129
+ Enabled: true
130
+
131
+ SketchupPerformance/Typename:
132
+ Description: Using `.typename` is very slow, prefer `.is_a?` instead.
133
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_performance.md#typename
134
+ Enabled: true
135
+
136
+
137
+ SketchupRequirements/ApiNamespace:
138
+ Description: Don't modify the SketchUp API namespace.
139
+ Details: >-
140
+ Modifying the API namespace could affect other extensions - making
141
+ it hard for other developers to determine what is going on.
142
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#apinamespace
143
+ Enabled: true
144
+
145
+ SketchupRequirements/Exit:
146
+ Description: Exit attempts to kill the Ruby interpreter.
147
+ Details: >-
148
+ SketchUp will trap `exit` and prevent that, with a message in the
149
+ console. But `exit!` is not trapped and with terminate SketchUp
150
+ without shutting down cleanly. Use `return`, `next` or `break`
151
+ instead.
152
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#exit
153
+ Enabled: true
154
+
155
+ SketchupRequirements/ExtensionNamespace:
156
+ Description: Confine extensions to a single root namespace.
157
+ Details: >-
158
+ To avoid clashing with other extensions a single root namespace
159
+ should all the extension's code.
160
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#extensionnamespace
161
+ Exceptions: []
162
+ Enabled: true
163
+
164
+ SketchupRequirements/FileStructure:
165
+ Description: Expected extension file structure not found.
166
+ Details: >-
167
+ Check that the extension conform to expected file structure with a
168
+ single root .rb file and a support folder with matching name.
169
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#filestructure
170
+ Enabled: true
171
+
172
+ SketchupRequirements/GemInstall:
173
+ Description: >-
174
+ Gem.install is unreliable in SketchUp, and can cause
175
+ extensions to clash.
176
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#geminstall
177
+ Enabled: true
178
+
179
+ SketchupRequirements/GetExtensionLicense:
180
+ Description: Pass in valid extension ID from local string literals.
181
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#getextensionlicense
182
+ Enabled: true
183
+
184
+ SketchupRequirements/GlobalConstants:
185
+ Description: Do not introduce global constants.
186
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#globalconstants
187
+ Enabled: true
188
+
189
+ SketchupRequirements/GlobalInclude:
190
+ Description: Do not include modules into global namespace.
191
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#globalinclude
192
+ Enabled: true
193
+
194
+ SketchupRequirements/GlobalMethods:
195
+ Description: Extensions should not define global methods.
196
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#globalmethods
197
+ Enabled: true
198
+
199
+ SketchupRequirements/GlobalVariables:
200
+ Description: Do not introduce global variables.
201
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#globalvariables
202
+ Enabled: true
203
+
204
+ SketchupRequirements/LanguageHandlerGlobals:
205
+ Description: Don't use other known global variables.
206
+ Details: >-
207
+ Avoid using globals in general, but especially these which are
208
+ known to be in use by other extensions made by SketchUp. They are
209
+ still in use due to compatibility reasons.
210
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#languagehandlerglobals
211
+ Enabled: true
212
+
213
+ SketchupRequirements/LoadPath:
214
+ Description: Do not modify the load path.
215
+ Details: >-
216
+ This can cause other extensions from not loading correctly. Always
217
+ load files relative to the installation path for the extension.
218
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#loadpath
219
+ Enabled: true
220
+
221
+ SketchupRequirements/MinimalRegistration:
222
+ Description: >-
223
+ Don't load extension files in the root file registering the
224
+ extension. Extensions should not load additional files when
225
+ it's disabled.
226
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#minimalregistration
227
+ Enabled: true
228
+
229
+ SketchupRequirements/ObserversStartOperation:
230
+ Description: Observers should create transparent operations.
231
+ Details: >-
232
+ When making model changes within an observer event, start a
233
+ transparent operation to ensure a clean undo-stack.
234
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#observersstartoperation
235
+ Enabled: true
236
+
237
+ SketchupRequirements/RegisterExtension:
238
+ Description: >-
239
+ Always register extensions to load by default. Otherwise it
240
+ might confuse users to think the extension isn't working.
241
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#registerextension
242
+ Enabled: true
243
+
244
+ SketchupRequirements/RequireToolsRubyFiles:
245
+ Description: >-
246
+ Due to how require and Sketchup.require checks whether a file
247
+ has been loaded, files from SketchUp's Tools folder should be
248
+ required in using `require` and with their file extension to
249
+ avoid duplicate loading.
250
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#requiretoolsrubyfiles
251
+ Enabled: true
252
+
253
+ SketchupRequirements/RubyCoreNamespace:
254
+ Description: Do not modify Ruby core functionality.
255
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#rubycorenamespace
256
+ Enabled: true
257
+
258
+ SketchupRequirements/RubyStdLibNamespace:
259
+ Description: Do not modify Ruby stdlib functionality.
260
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#rubystdlibnamespace
261
+ Enabled: true
262
+
263
+ SketchupRequirements/SketchupRequire:
264
+ Description: >-
265
+ Omit file extensions when using `Sketchup.require` to allow
266
+ encrypted files to be loaded.
267
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#sketchuprequire
268
+ Enabled: true
269
+
270
+ SketchupRequirements/ShippedExtensionsNamespace:
271
+ Description: Don't use the namespace of SketchUp's shipped extensions.
272
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#shippedextensionsnamespace
273
+ Enabled: true
274
+
275
+ SketchupRequirements/SketchupExtension:
276
+ Description: >-
277
+ Register a single instance of SketchupExtension per extension.
278
+ This should be done by the root .rb file in the extension
279
+ package.
280
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#sketchupextension
281
+ Enabled: true
282
+
283
+
284
+ SketchupSuggestions/AddGroup:
285
+ Description: Avoid creating groups out of existing entities.
286
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#addgroup
287
+ Enabled: true
288
+
289
+ SketchupSuggestions/Compatibility:
290
+ Description: Incompatible feature with target SketchUp version.
291
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#compatibility
292
+ Enabled: true
293
+
294
+ SketchupSuggestions/DynamicComponentInternals:
295
+ Description: >-
296
+ Avoid relying on internal logic of Dynamic Components. It's
297
+ behavior might change between versions.
298
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#dynamiccomponentinternals
299
+ Enabled: true
300
+
301
+ SketchupSuggestions/FileEncoding:
302
+ Description: Beware encoding bug in Ruby when using `__FILE__` and `__dir__`.
303
+ Details: >-
304
+ When using `__FILE__` and `__dir__`, beware that Ruby doesn't
305
+ apply the correct encoding to the strings under Windows. When they
306
+ contain non-english characters it will lead to exceptions being
307
+ raised when the strings are used. Force encoding to work around
308
+ this.
309
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#fileencoding
310
+ Enabled: true
311
+
312
+ SketchupSuggestions/ModelEntities:
313
+ Description: >-
314
+ Typically one should use `model.active_entities` instead of
315
+ `model.entities`.
316
+ Details: >-
317
+ In SketchUp the norm is that editing is performed in the opened
318
+ instance (`model.active_entities`). `model.entities` refer to the
319
+ model root.
320
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#modelentities
321
+ Enabled: true
322
+
323
+ SketchupSuggestions/MonkeyPatchedApi:
324
+ Description: >-
325
+ Avoid using monkey-patched methods from SketchUp's shipped
326
+ extensions.
327
+ Details: >-
328
+ These methods stops working when the extensions are disabled and
329
+ may change or be removed.
330
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#monkeypatchedapi
331
+ Enabled: true
332
+
333
+ SketchupSuggestions/OperationName:
334
+ Description: >-
335
+ Check that operation names are human friendly and consistent
336
+ with SketchUp.
337
+ Details: >-
338
+ This check is very naive and might produce false positives. Use as
339
+ guidance only.
340
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#operationname
341
+ Max: 25
342
+ Enabled: true
343
+
344
+ SketchupSuggestions/SketchupFindSupportFile:
345
+ Description: >-
346
+ Avoid `Sketchup.find_support_file` to find your extension's
347
+ files.
348
+ Details: >-
349
+ Extensions might be installed outside the SketchUp Plugins folder.
350
+ Use `__FILE__` and `__dir__` to locate your files relative to the
351
+ executing file.
352
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#sketchupfindsupportfile
353
+ Enabled: true
354
+
355
+ SketchupSuggestions/ToolDrawingBounds:
356
+ Description: >-
357
+ When drawing to the viewport implement `getExtents` so drawn
358
+ geometry is not clipped.
359
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#tooldrawingbounds
360
+ Enabled: true
361
+
362
+ SketchupSuggestions/ToolInvalidate:
363
+ Description: >-
364
+ When drawing to the viewport, make sure tools invalidate when
365
+ tool becomes inactive.
366
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#toolinvalidate
367
+ Enabled: true
368
+
369
+ SketchupSuggestions/ToolUserInput:
370
+ Description: >-
371
+ When a tool is accepting user input, make sure to define
372
+ enableVCB?.
373
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#tooluserinput
374
+ Enabled: true
375
+
376
+ SketchupSuggestions/ToolbarTimer:
377
+ Description: Wrapping `toolbar.restore` in `UI.start_timer` is redundant.
378
+ Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_suggestions.md#toolbartimer
379
+ Enabled: true