rubocop-sketchup 0.15.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/Gemfile +2 -2
- data/lib/rubocop/sketchup/cop/requirements/get_extension_license.rb +1 -1
- data/lib/rubocop/sketchup/cop/requirements/sketchup_require.rb +1 -15
- data/lib/rubocop/sketchup/features.rb +67 -0
- data/lib/rubocop/sketchup/sketchup_version.rb +1 -0
- data/lib/rubocop/sketchup/version.rb +1 -1
- data/rubocop-sketchup.gemspec +2 -2
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b427141ab0bf473dda0cb9a9f896d2733634b4d640050a643cb6782fbe20b8ee
|
4
|
+
data.tar.gz: 7bcbd253ca25dd0ec5aa8eb59d1fa1752e1c43b2c2316b962f571ce2b530600c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 870f52b31064818785e18215714c40dd1a83c3f367e178bb640ee2a3525e30c7f34a9b47ba4cf3358e737666c349f7e35c1b5c1335e25bd4783984753c469e02
|
7
|
+
data.tar.gz: a0e29858b9156a313530c850316ec07915c7313e19705356b8cf850e0a3950a15dfc4e247d20c60c1382aa1ad84faa4d14c00e5bb3945c45d2c2507cf96ee6b3
|
data/Gemfile
CHANGED
@@ -8,12 +8,12 @@ group :test do
|
|
8
8
|
gem 'appveyor-worker', '~> 0.2', require: false
|
9
9
|
gem 'rake', '~> 12.0', require: false
|
10
10
|
gem 'rspec', '~> 3.7', require: false
|
11
|
+
gem 'rubocop-performance', require: false
|
12
|
+
gem 'simplecov', '~> 0.10', require: false
|
11
13
|
end
|
12
14
|
|
13
15
|
group :development do
|
14
16
|
gem 'bump', '~> 0.5', require: false
|
15
|
-
gem 'rubocop-performance', require: false
|
16
|
-
gem 'simplecov', '~> 0.10', require: false
|
17
17
|
gem 'solargraph', '~> 0.34', require: false
|
18
18
|
gem 'thor', '~> 0.20', require: false
|
19
19
|
gem 'yard', '~> 0.9', require: false
|
@@ -7,8 +7,7 @@ module RuboCop
|
|
7
7
|
# files to be loaded.
|
8
8
|
#
|
9
9
|
# Ruby C extensions, `.so`/`.bundle` libraries must always be loaded via
|
10
|
-
# the normal `require`.
|
11
|
-
# will resolve the`.so`/`.bundle` automatically.
|
10
|
+
# the normal `require`.
|
12
11
|
#
|
13
12
|
# @example Bad - This will fail if extension is encrypted
|
14
13
|
# Sketchup.require 'hello/world.rb'
|
@@ -36,9 +35,6 @@ module RuboCop
|
|
36
35
|
MSG_REQUIRE_FOR_BINARY = 'Use `require` instead of `Sketchup.require` '\
|
37
36
|
'to load binary Ruby libraries.'
|
38
37
|
|
39
|
-
MSG_OMIT_BINARY_EXT = 'Do not hard code .so/.bundle file '\
|
40
|
-
'extensions'
|
41
|
-
|
42
38
|
MSG_REQUIRE_ENCRYPTED = 'Use `Sketchup.require` when loading Ruby '\
|
43
39
|
'files for encrypted extensions.'
|
44
40
|
|
@@ -80,7 +76,6 @@ module RuboCop
|
|
80
76
|
|
81
77
|
elsif ruby_require?(node)
|
82
78
|
filename = ruby_require(node)
|
83
|
-
return if check_binary_ruby_require(node, filename)
|
84
79
|
return if check_encrypted_require(node, filename)
|
85
80
|
|
86
81
|
elsif sketchup_extension_new?(node)
|
@@ -108,15 +103,6 @@ module RuboCop
|
|
108
103
|
true
|
109
104
|
end
|
110
105
|
|
111
|
-
def check_binary_ruby_require(node, filename)
|
112
|
-
ext_name = File.extname(filename)
|
113
|
-
return unless %w[.so .bundle].include?(ext_name)
|
114
|
-
|
115
|
-
add_offense(node, location: file_ext_range(node.arguments.first),
|
116
|
-
message: MSG_OMIT_BINARY_EXT)
|
117
|
-
true
|
118
|
-
end
|
119
|
-
|
120
106
|
def check_sketchup_require_filename(node, filename)
|
121
107
|
return if valid_filename?(filename)
|
122
108
|
|
@@ -18,9 +18,16 @@
|
|
18
18
|
# positives. The method names should be names that are not commonly used in
|
19
19
|
# general context.
|
20
20
|
#
|
21
|
+
# Since it's difficult to know what a variable in Ruby code represent by static
|
22
|
+
# analysis, these methods are assumed to belong to the FEATURES list.
|
23
|
+
#
|
21
24
|
# When a new version is released and FEATURES is updated the new methods from
|
22
25
|
# the new version should be considered for this list.
|
23
26
|
#
|
27
|
+
# TODO(thomthom): Investigate if Solargraph's static analysis can be used to
|
28
|
+
# provide a more accurate analysis. Not sure how well it works on code bases
|
29
|
+
# that isn't well documented with YARD type tags.
|
30
|
+
#
|
24
31
|
#
|
25
32
|
# OBSERVER_METHODS constant:
|
26
33
|
#
|
@@ -34,6 +41,48 @@ module RuboCop
|
|
34
41
|
|
35
42
|
FEATURES = [
|
36
43
|
|
44
|
+
{
|
45
|
+
version: 'LayOut 2020.1',
|
46
|
+
types: {
|
47
|
+
method: [
|
48
|
+
'Layout::Document#export',
|
49
|
+
'Layout::Grid#clip_to_margins=',
|
50
|
+
'Layout::Grid#clip_to_margins?',
|
51
|
+
'Layout::Grid#in_front=',
|
52
|
+
'Layout::Grid#in_front?',
|
53
|
+
'Layout::Grid#major_color=',
|
54
|
+
'Layout::Grid#major_spacing=',
|
55
|
+
'Layout::Grid#minor_color=',
|
56
|
+
'Layout::Grid#minor_divisions=',
|
57
|
+
'Layout::Grid#print=',
|
58
|
+
'Layout::Grid#show=',
|
59
|
+
'Layout::Grid#show_major=',
|
60
|
+
'Layout::Grid#show_minor=',
|
61
|
+
'Layout::SketchUpModel#camera_modified?',
|
62
|
+
'Layout::SketchUpModel#effects_modified?',
|
63
|
+
'Layout::SketchUpModel#layers_modified?',
|
64
|
+
'Layout::SketchUpModel#reset_camera',
|
65
|
+
'Layout::SketchUpModel#reset_effects',
|
66
|
+
'Layout::SketchUpModel#reset_layers',
|
67
|
+
'Layout::SketchUpModel#reset_style',
|
68
|
+
'Layout::SketchUpModel#style_modified?',
|
69
|
+
],
|
70
|
+
},
|
71
|
+
},
|
72
|
+
|
73
|
+
{
|
74
|
+
version: 'SketchUp 2020.1',
|
75
|
+
types: {
|
76
|
+
method: [
|
77
|
+
'Sketchup::Entities#weld',
|
78
|
+
'Sketchup::Page#use_hidden_geometry=',
|
79
|
+
'Sketchup::Page#use_hidden_geometry?',
|
80
|
+
'Sketchup::Page#use_hidden_objects=',
|
81
|
+
'Sketchup::Page#use_hidden_objects?',
|
82
|
+
],
|
83
|
+
},
|
84
|
+
},
|
85
|
+
|
37
86
|
{
|
38
87
|
version: 'SketchUp 2020.0',
|
39
88
|
types: {
|
@@ -1097,8 +1146,11 @@ module RuboCop
|
|
1097
1146
|
attached_to
|
1098
1147
|
attached_to=
|
1099
1148
|
boundingbox_pick
|
1149
|
+
camera_modified?
|
1100
1150
|
center_2d
|
1101
1151
|
classifications
|
1152
|
+
clip_to_margins?
|
1153
|
+
clip_to_margins=
|
1102
1154
|
colorize_deltas
|
1103
1155
|
colorize_type
|
1104
1156
|
colorize_type=
|
@@ -1107,6 +1159,7 @@ module RuboCop
|
|
1107
1159
|
days_remaining
|
1108
1160
|
drawing_element_visible?
|
1109
1161
|
edit_transform
|
1162
|
+
effects_modified?
|
1110
1163
|
end_attached_to
|
1111
1164
|
end_attached_to=
|
1112
1165
|
error_description
|
@@ -1127,12 +1180,15 @@ module RuboCop
|
|
1127
1180
|
icon_tooltip
|
1128
1181
|
icon_tooltip=
|
1129
1182
|
image_rep
|
1183
|
+
in_front?
|
1184
|
+
in_front=
|
1130
1185
|
include_in_animation?
|
1131
1186
|
include_in_animation=
|
1132
1187
|
instance_path
|
1133
1188
|
instance_path_from_pid_path
|
1134
1189
|
is_polygon?
|
1135
1190
|
large_icon
|
1191
|
+
layers_modified?
|
1136
1192
|
leader_break_point
|
1137
1193
|
leader_break_point=
|
1138
1194
|
leader_points
|
@@ -1145,7 +1201,11 @@ module RuboCop
|
|
1145
1201
|
local_bounds
|
1146
1202
|
lower_left
|
1147
1203
|
lower_right
|
1204
|
+
major_color=
|
1205
|
+
major_spacing=
|
1148
1206
|
menu_text
|
1207
|
+
minor_color=
|
1208
|
+
minor_divisions=
|
1149
1209
|
mipmapping?
|
1150
1210
|
mipmapping=
|
1151
1211
|
navigation_buttons_enabled?
|
@@ -1161,6 +1221,10 @@ module RuboCop
|
|
1161
1221
|
persistent_id_path
|
1162
1222
|
refresh_thumbnail
|
1163
1223
|
remove_classification
|
1224
|
+
reset_camera
|
1225
|
+
reset_effects
|
1226
|
+
reset_layers
|
1227
|
+
reset_style
|
1164
1228
|
same_direction?
|
1165
1229
|
scale_2d
|
1166
1230
|
screen_scale_factor
|
@@ -1174,11 +1238,14 @@ module RuboCop
|
|
1174
1238
|
set_upload_progress_callback
|
1175
1239
|
set_uv
|
1176
1240
|
show_differences
|
1241
|
+
show_major=
|
1242
|
+
show_minor=
|
1177
1243
|
sketch_plane
|
1178
1244
|
small_icon
|
1179
1245
|
start_attached_to
|
1180
1246
|
start_attached_to=
|
1181
1247
|
status_bar_text
|
1248
|
+
style_modified?
|
1182
1249
|
text_bounds
|
1183
1250
|
unit_vector?
|
1184
1251
|
unload_schema
|
data/rubocop-sketchup.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
|
14
14
|
spec.version = RuboCop::SketchUp::VERSION
|
15
15
|
spec.platform = Gem::Platform::RUBY
|
16
|
-
spec.required_ruby_version = '>= 2.
|
16
|
+
spec.required_ruby_version = '>= 2.4.0'
|
17
17
|
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
spec.files = Dir[
|
@@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
|
|
24
24
|
'Gemfile'
|
25
25
|
]
|
26
26
|
|
27
|
-
spec.add_dependency 'rubocop', '>= 0.
|
27
|
+
spec.add_dependency 'rubocop', '>= 0.82', '<= 0.86'
|
28
28
|
spec.add_development_dependency 'bundler', '>= 1.13', '< 3.0'
|
29
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-sketchup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trimble Inc, SketchUp Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,20 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.82'
|
20
20
|
- - "<="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '0.
|
22
|
+
version: '0.86'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
29
|
+
version: '0.82'
|
30
30
|
- - "<="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '0.
|
32
|
+
version: '0.86'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,15 +137,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
137
137
|
requirements:
|
138
138
|
- - ">="
|
139
139
|
- !ruby/object:Gem::Version
|
140
|
-
version: 2.
|
140
|
+
version: 2.4.0
|
141
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
|
-
|
148
|
-
rubygems_version: 2.6.14
|
147
|
+
rubygems_version: 3.0.3
|
149
148
|
signing_key:
|
150
149
|
specification_version: 4
|
151
150
|
summary: RuboCop rules for SketchUp extensions.
|