rubocop-sketchup 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +21 -20
  3. data/assets/output.html.erb +301 -301
  4. data/config/default.yml +400 -379
  5. data/lib/rubocop/sketchup/config.rb +63 -63
  6. data/lib/rubocop/sketchup/cop/bugs/material_name.rb +108 -108
  7. data/lib/rubocop/sketchup/cop/bugs/render_mode.rb +72 -72
  8. data/lib/rubocop/sketchup/cop/bugs/uniform_scaling.rb +36 -36
  9. data/lib/rubocop/sketchup/cop/deprecations/add_separator_to_menu.rb +25 -25
  10. data/lib/rubocop/sketchup/cop/deprecations/operation_next_transparent.rb +30 -30
  11. data/lib/rubocop/sketchup/cop/deprecations/require_all.rb +27 -27
  12. data/lib/rubocop/sketchup/cop/deprecations/set_texture_projection.rb +26 -26
  13. data/lib/rubocop/sketchup/cop/deprecations/show_ruby_panel.rb +25 -25
  14. data/lib/rubocop/sketchup/cop/deprecations/sketchup_set.rb +30 -30
  15. data/lib/rubocop/sketchup/cop/performance/openssl.rb +41 -41
  16. data/lib/rubocop/sketchup/cop/performance/operation_disable_ui.rb +33 -33
  17. data/lib/rubocop/sketchup/cop/performance/selection_bulk.rb +79 -79
  18. data/lib/rubocop/sketchup/cop/performance/type_check.rb +63 -63
  19. data/lib/rubocop/sketchup/cop/performance/typename.rb +24 -24
  20. data/lib/rubocop/sketchup/cop/requirements/api_namespace.rb +30 -30
  21. data/lib/rubocop/sketchup/cop/requirements/debug_mode.rb +27 -0
  22. data/lib/rubocop/sketchup/cop/requirements/exit.rb +33 -33
  23. data/lib/rubocop/sketchup/cop/requirements/extension_namespace.rb +125 -125
  24. data/lib/rubocop/sketchup/cop/requirements/file_structure.rb +97 -97
  25. data/lib/rubocop/sketchup/cop/requirements/gem_install.rb +45 -45
  26. data/lib/rubocop/sketchup/cop/requirements/get_extension_license.rb +95 -95
  27. data/lib/rubocop/sketchup/cop/requirements/global_constants.rb +38 -38
  28. data/lib/rubocop/sketchup/cop/requirements/global_include.rb +42 -42
  29. data/lib/rubocop/sketchup/cop/requirements/global_methods.rb +65 -65
  30. data/lib/rubocop/sketchup/cop/requirements/global_variables.rb +95 -95
  31. data/lib/rubocop/sketchup/cop/requirements/initialize_entity.rb +76 -0
  32. data/lib/rubocop/sketchup/cop/requirements/language_handler_globals.rb +46 -46
  33. data/lib/rubocop/sketchup/cop/requirements/load_path.rb +83 -83
  34. data/lib/rubocop/sketchup/cop/requirements/minimal_registration.rb +73 -73
  35. data/lib/rubocop/sketchup/cop/requirements/observers_start_operation.rb +161 -161
  36. data/lib/rubocop/sketchup/cop/requirements/register_extension.rb +45 -45
  37. data/lib/rubocop/sketchup/cop/requirements/ruby_core_namespace.rb +291 -291
  38. data/lib/rubocop/sketchup/cop/requirements/ruby_stdlib_namespace.rb +634 -634
  39. data/lib/rubocop/sketchup/cop/requirements/shipped_extensions_namespace.rb +61 -61
  40. data/lib/rubocop/sketchup/cop/requirements/sketchup_extension.rb +119 -119
  41. data/lib/rubocop/sketchup/cop/requirements/sketchup_require.rb +150 -150
  42. data/lib/rubocop/sketchup/cop/suggestions/add_group.rb +49 -49
  43. data/lib/rubocop/sketchup/cop/suggestions/compatibility.rb +128 -128
  44. data/lib/rubocop/sketchup/cop/suggestions/dc_internals.rb +34 -34
  45. data/lib/rubocop/sketchup/cop/suggestions/file_encoding.rb +78 -78
  46. data/lib/rubocop/sketchup/cop/suggestions/model_entities.rb +58 -58
  47. data/lib/rubocop/sketchup/cop/suggestions/monkey_patched_api.rb +45 -45
  48. data/lib/rubocop/sketchup/cop/suggestions/operation_name.rb +137 -137
  49. data/lib/rubocop/sketchup/cop/suggestions/sketchup_find_support_file.rb +39 -39
  50. data/lib/rubocop/sketchup/cop/suggestions/sleep.rb +25 -0
  51. data/lib/rubocop/sketchup/cop/suggestions/tool_drawing_bounds.rb +45 -45
  52. data/lib/rubocop/sketchup/cop/suggestions/tool_invalidate.rb +68 -68
  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/cop.rb +110 -110
  56. data/lib/rubocop/sketchup/dc_globals.rb +24 -24
  57. data/lib/rubocop/sketchup/dc_methods.rb +130 -130
  58. data/lib/rubocop/sketchup/extension_project.rb +65 -65
  59. data/lib/rubocop/sketchup/features.rb +1514 -1477
  60. data/lib/rubocop/sketchup/formatter/extension_review.rb +269 -269
  61. data/lib/rubocop/sketchup/generator.rb +21 -0
  62. data/lib/rubocop/sketchup/inject.rb +19 -19
  63. data/lib/rubocop/sketchup/namespace.rb +49 -49
  64. data/lib/rubocop/sketchup/namespace_checker.rb +103 -103
  65. data/lib/rubocop/sketchup/no_comment_disable.rb +17 -17
  66. data/lib/rubocop/sketchup/range_help.rb +52 -52
  67. data/lib/rubocop/sketchup/sketchup_target_range.rb +75 -75
  68. data/lib/rubocop/sketchup/sketchup_version.rb +131 -129
  69. data/lib/rubocop/sketchup/tool_checker.rb +41 -41
  70. data/lib/rubocop/sketchup/version.rb +7 -7
  71. data/lib/rubocop/sketchup.rb +14 -14
  72. data/lib/rubocop-sketchup.rb +53 -53
  73. data/rubocop-sketchup.gemspec +28 -29
  74. metadata +7 -23
@@ -1,291 +1,291 @@
1
- # frozen_string_literal: true
2
-
3
- module RuboCop
4
- module Cop
5
- module SketchupRequirements
6
- # Extensions in SketchUp all share the same Ruby environment on the user's
7
- # machine. Because of this it's important that each extension isolate
8
- # itself to avoid clashing with other extensions.
9
- #
10
- # Extensions submitted to Extension Warehouse is expected to not modify
11
- # core Ruby functionality.
12
- class RubyCoreNamespace < SketchUp::Cop
13
-
14
- include SketchUp::NoCommentDisable
15
- include SketchUp::NamespaceChecker
16
-
17
- MSG = 'Do not modify Ruby core functionality.'
18
-
19
- # We check only against the top level namespaces. The core define more
20
- # objects, but they are under one of the top level namespaces listed.
21
-
22
- NAMESPACES_RUBY_186 = %w[
23
- ArgumentError
24
- Array
25
- Bignum
26
- Binding
27
- Class
28
- Comparable
29
- Continuation
30
- Data
31
- Dir
32
- EOFError
33
- Enumerable
34
- Errno
35
- Exception
36
- FalseClass
37
- File
38
- FileTest
39
- Fixnum
40
- Float
41
- FloatDomainError
42
- GC
43
- Hash
44
- IO
45
- IOError
46
- IndexError
47
- Integer
48
- Interrupt
49
- Kernel
50
- LoadError
51
- LocalJumpError
52
- Marshal
53
- MatchData
54
- Math
55
- Method
56
- Module
57
- NameError
58
- NilClass
59
- NoMemoryError
60
- NoMethodError
61
- NotImplementedError
62
- Numeric
63
- Object
64
- ObjectSpace
65
- Precision
66
- Proc
67
- Process
68
- Range
69
- RangeError
70
- Regexp
71
- RegexpError
72
- RuntimeError
73
- ScriptError
74
- SecurityError
75
- Signal
76
- SignalException
77
- StandardError
78
- String
79
- Struct
80
- Symbol
81
- SyntaxError
82
- SystemCallError
83
- SystemExit
84
- SystemStackError
85
- Thread
86
- ThreadError
87
- ThreadGroup
88
- Time
89
- TrueClass
90
- TypeError
91
- UnboundMethod
92
- ZeroDivisionError
93
- ].freeze
94
-
95
- NAMESPACES_RUBY_200 = %w[
96
- ARGF
97
- ArgumentError
98
- Array
99
- BasicObject
100
- Bignum
101
- Binding
102
- Class
103
- Comparable
104
- Complex
105
- Continuation
106
- Data
107
- Dir
108
- ENV
109
- EOFError
110
- Encoding
111
- EncodingError
112
- Enumerable
113
- Enumerator
114
- Errno
115
- Exception
116
- FalseClass
117
- Fiber
118
- FiberError
119
- File
120
- FileTest
121
- Fixnum
122
- Float
123
- FloatDomainError
124
- GC
125
- Hash
126
- IO
127
- IOError
128
- IndexError
129
- Integer
130
- Interrupt
131
- Kernel
132
- KeyError
133
- LoadError
134
- LocalJumpError
135
- Marshal
136
- MatchData
137
- Math
138
- Method
139
- Module
140
- Mutex
141
- NameError
142
- NilClass
143
- NoMemoryError
144
- NoMethodError
145
- NotImplementedError
146
- Numeric
147
- Object
148
- ObjectSpace
149
- Proc
150
- Process
151
- Random
152
- Range
153
- RangeError
154
- Rational
155
- Regexp
156
- RegexpError
157
- RubyVM
158
- RuntimeError
159
- ScriptError
160
- SecurityError
161
- Signal
162
- SignalException
163
- StandardError
164
- StopIteration
165
- String
166
- Struct
167
- Symbol
168
- SyntaxError
169
- SystemCallError
170
- SystemExit
171
- SystemStackError
172
- Thread
173
- ThreadError
174
- ThreadGroup
175
- Time
176
- TracePoint
177
- TrueClass
178
- TypeError
179
- UnboundMethod
180
- ZeroDivisionError
181
- ].freeze
182
-
183
- NAMESPACES_RUBY_220 = %w[
184
- ArgumentError
185
- Array
186
- BasicObject
187
- Bignum
188
- Binding
189
- Class
190
- Comparable
191
- Complex
192
- ConditionVariable
193
- Continuation
194
- Data
195
- Dir
196
- ENV
197
- EOFError
198
- Encoding
199
- EncodingError
200
- Enumerable
201
- Enumerator
202
- Errno
203
- Exception
204
- FalseClass
205
- Fiber
206
- FiberError
207
- File
208
- FileTest
209
- Fixnum
210
- Float
211
- FloatDomainError
212
- GC
213
- Hash
214
- IO
215
- IOError
216
- IndexError
217
- Integer
218
- Interrupt
219
- Kernel
220
- KeyError
221
- LoadError
222
- LocalJumpError
223
- Marshal
224
- MatchData
225
- Math
226
- Method
227
- Module
228
- Mutex
229
- NameError
230
- NilClass
231
- NoMemoryError
232
- NoMethodError
233
- NotImplementedError
234
- Numeric
235
- Object
236
- ObjectSpace
237
- Proc
238
- Process
239
- Queue
240
- Random
241
- Range
242
- RangeError
243
- Rational
244
- Regexp
245
- RegexpError
246
- RubyVM
247
- RuntimeError
248
- ScriptError
249
- SecurityError
250
- Signal
251
- SignalException
252
- SizedQueue
253
- StandardError
254
- StopIteration
255
- String
256
- Struct
257
- Symbol
258
- SyntaxError
259
- SystemCallError
260
- SystemExit
261
- SystemStackError
262
- Thread
263
- ThreadError
264
- ThreadGroup
265
- Time
266
- TracePoint
267
- TrueClass
268
- TypeError
269
- UnboundMethod
270
- UncaughtThrowError
271
- ZeroDivisionError
272
- ].freeze
273
-
274
- NAMESPACES = (
275
- (
276
- NAMESPACES_RUBY_186 |
277
- NAMESPACES_RUBY_200 |
278
- NAMESPACES_RUBY_220
279
- # Remove Object because this is the global namespace and there are
280
- # other checks for this.
281
- ) - ['Object']
282
- ).freeze
283
-
284
- def namespaces
285
- NAMESPACES
286
- end
287
-
288
- end
289
- end
290
- end
291
- end
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module SketchupRequirements
6
+ # Extensions in SketchUp all share the same Ruby environment on the user's
7
+ # machine. Because of this it's important that each extension isolate
8
+ # itself to avoid clashing with other extensions.
9
+ #
10
+ # Extensions submitted to Extension Warehouse is expected to not modify
11
+ # core Ruby functionality.
12
+ class RubyCoreNamespace < SketchUp::Cop
13
+
14
+ include SketchUp::NoCommentDisable
15
+ include SketchUp::NamespaceChecker
16
+
17
+ MSG = 'Do not modify Ruby core functionality.'
18
+
19
+ # We check only against the top level namespaces. The core define more
20
+ # objects, but they are under one of the top level namespaces listed.
21
+
22
+ NAMESPACES_RUBY_186 = %w[
23
+ ArgumentError
24
+ Array
25
+ Bignum
26
+ Binding
27
+ Class
28
+ Comparable
29
+ Continuation
30
+ Data
31
+ Dir
32
+ EOFError
33
+ Enumerable
34
+ Errno
35
+ Exception
36
+ FalseClass
37
+ File
38
+ FileTest
39
+ Fixnum
40
+ Float
41
+ FloatDomainError
42
+ GC
43
+ Hash
44
+ IO
45
+ IOError
46
+ IndexError
47
+ Integer
48
+ Interrupt
49
+ Kernel
50
+ LoadError
51
+ LocalJumpError
52
+ Marshal
53
+ MatchData
54
+ Math
55
+ Method
56
+ Module
57
+ NameError
58
+ NilClass
59
+ NoMemoryError
60
+ NoMethodError
61
+ NotImplementedError
62
+ Numeric
63
+ Object
64
+ ObjectSpace
65
+ Precision
66
+ Proc
67
+ Process
68
+ Range
69
+ RangeError
70
+ Regexp
71
+ RegexpError
72
+ RuntimeError
73
+ ScriptError
74
+ SecurityError
75
+ Signal
76
+ SignalException
77
+ StandardError
78
+ String
79
+ Struct
80
+ Symbol
81
+ SyntaxError
82
+ SystemCallError
83
+ SystemExit
84
+ SystemStackError
85
+ Thread
86
+ ThreadError
87
+ ThreadGroup
88
+ Time
89
+ TrueClass
90
+ TypeError
91
+ UnboundMethod
92
+ ZeroDivisionError
93
+ ].freeze
94
+
95
+ NAMESPACES_RUBY_200 = %w[
96
+ ARGF
97
+ ArgumentError
98
+ Array
99
+ BasicObject
100
+ Bignum
101
+ Binding
102
+ Class
103
+ Comparable
104
+ Complex
105
+ Continuation
106
+ Data
107
+ Dir
108
+ ENV
109
+ EOFError
110
+ Encoding
111
+ EncodingError
112
+ Enumerable
113
+ Enumerator
114
+ Errno
115
+ Exception
116
+ FalseClass
117
+ Fiber
118
+ FiberError
119
+ File
120
+ FileTest
121
+ Fixnum
122
+ Float
123
+ FloatDomainError
124
+ GC
125
+ Hash
126
+ IO
127
+ IOError
128
+ IndexError
129
+ Integer
130
+ Interrupt
131
+ Kernel
132
+ KeyError
133
+ LoadError
134
+ LocalJumpError
135
+ Marshal
136
+ MatchData
137
+ Math
138
+ Method
139
+ Module
140
+ Mutex
141
+ NameError
142
+ NilClass
143
+ NoMemoryError
144
+ NoMethodError
145
+ NotImplementedError
146
+ Numeric
147
+ Object
148
+ ObjectSpace
149
+ Proc
150
+ Process
151
+ Random
152
+ Range
153
+ RangeError
154
+ Rational
155
+ Regexp
156
+ RegexpError
157
+ RubyVM
158
+ RuntimeError
159
+ ScriptError
160
+ SecurityError
161
+ Signal
162
+ SignalException
163
+ StandardError
164
+ StopIteration
165
+ String
166
+ Struct
167
+ Symbol
168
+ SyntaxError
169
+ SystemCallError
170
+ SystemExit
171
+ SystemStackError
172
+ Thread
173
+ ThreadError
174
+ ThreadGroup
175
+ Time
176
+ TracePoint
177
+ TrueClass
178
+ TypeError
179
+ UnboundMethod
180
+ ZeroDivisionError
181
+ ].freeze
182
+
183
+ NAMESPACES_RUBY_220 = %w[
184
+ ArgumentError
185
+ Array
186
+ BasicObject
187
+ Bignum
188
+ Binding
189
+ Class
190
+ Comparable
191
+ Complex
192
+ ConditionVariable
193
+ Continuation
194
+ Data
195
+ Dir
196
+ ENV
197
+ EOFError
198
+ Encoding
199
+ EncodingError
200
+ Enumerable
201
+ Enumerator
202
+ Errno
203
+ Exception
204
+ FalseClass
205
+ Fiber
206
+ FiberError
207
+ File
208
+ FileTest
209
+ Fixnum
210
+ Float
211
+ FloatDomainError
212
+ GC
213
+ Hash
214
+ IO
215
+ IOError
216
+ IndexError
217
+ Integer
218
+ Interrupt
219
+ Kernel
220
+ KeyError
221
+ LoadError
222
+ LocalJumpError
223
+ Marshal
224
+ MatchData
225
+ Math
226
+ Method
227
+ Module
228
+ Mutex
229
+ NameError
230
+ NilClass
231
+ NoMemoryError
232
+ NoMethodError
233
+ NotImplementedError
234
+ Numeric
235
+ Object
236
+ ObjectSpace
237
+ Proc
238
+ Process
239
+ Queue
240
+ Random
241
+ Range
242
+ RangeError
243
+ Rational
244
+ Regexp
245
+ RegexpError
246
+ RubyVM
247
+ RuntimeError
248
+ ScriptError
249
+ SecurityError
250
+ Signal
251
+ SignalException
252
+ SizedQueue
253
+ StandardError
254
+ StopIteration
255
+ String
256
+ Struct
257
+ Symbol
258
+ SyntaxError
259
+ SystemCallError
260
+ SystemExit
261
+ SystemStackError
262
+ Thread
263
+ ThreadError
264
+ ThreadGroup
265
+ Time
266
+ TracePoint
267
+ TrueClass
268
+ TypeError
269
+ UnboundMethod
270
+ UncaughtThrowError
271
+ ZeroDivisionError
272
+ ].freeze
273
+
274
+ NAMESPACES = (
275
+ (
276
+ NAMESPACES_RUBY_186 |
277
+ NAMESPACES_RUBY_200 |
278
+ NAMESPACES_RUBY_220
279
+ # Remove Object because this is the global namespace and there are
280
+ # other checks for this.
281
+ ) - ['Object']
282
+ ).freeze
283
+
284
+ def namespaces
285
+ NAMESPACES
286
+ end
287
+
288
+ end
289
+ end
290
+ end
291
+ end