rubocop-sketchup 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +19 -19
- data/assets/output.html.erb +301 -301
- data/config/default.yml +355 -355
- data/lib/rubocop/sketchup/config.rb +63 -63
- 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 +32 -32
- data/lib/rubocop/sketchup/cop/requirements/extension_namespace.rb +108 -108
- 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 +163 -163
- data/lib/rubocop/sketchup/cop/suggestions/add_group.rb +49 -49
- data/lib/rubocop/sketchup/cop/suggestions/compatibility.rb +117 -117
- 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 +103 -103
- data/lib/rubocop/sketchup/cop/suggestions/sketchup_find_support_file.rb +39 -39
- data/lib/rubocop/sketchup/cop/suggestions/tool_drawing_bounds.rb +44 -44
- data/lib/rubocop/sketchup/cop/suggestions/tool_invalidate.rb +66 -66
- 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 +111 -111
- 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 +738 -738
- data/lib/rubocop/sketchup/formatter/extension_review.rb +259 -259
- data/lib/rubocop/sketchup/inject.rb +19 -19
- data/lib/rubocop/sketchup/namespace.rb +47 -47
- data/lib/rubocop/sketchup/namespace_checker.rb +46 -46
- data/lib/rubocop/sketchup/no_comment_disable.rb +17 -17
- data/lib/rubocop/sketchup/range_help.rb +52 -52
- data/lib/rubocop/sketchup/sketchup_version.rb +87 -87
- data/lib/rubocop/sketchup/tool_checker.rb +43 -43
- data/lib/rubocop/sketchup/version.rb +5 -5
- data/lib/rubocop/sketchup.rb +12 -12
- data/lib/rubocop-sketchup.rb +48 -48
- data/rubocop-sketchup.gemspec +27 -27
- metadata +4 -4
data/config/default.yml
CHANGED
@@ -1,355 +1,355 @@
|
|
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
|
+
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
|