rubocop-sketchup 0.15.3 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/config/default.yml +2 -2
- data/lib/rubocop-sketchup.rb +1 -1
- data/lib/rubocop/sketchup/cop.rb +11 -12
- data/lib/rubocop/sketchup/cop/requirements/get_extension_license.rb +1 -1
- data/lib/rubocop/sketchup/features.rb +71 -0
- data/lib/rubocop/sketchup/formatter/extension_review.rb +1 -1
- data/lib/rubocop/sketchup/sketchup_version.rb +7 -4
- data/lib/rubocop/sketchup/version.rb +1 -1
- data/rubocop-sketchup.gemspec +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 296266d556b988a46320807d3f1a7023a29eac0f27d1d6c224c5cc86554ddf1b
|
4
|
+
data.tar.gz: 8d0c5a738811e681ddbcab81d5c6ab93ee6228c0d1e9cf9154bc225bb5452f06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8916d683a516025a8ed848037b65f5a2e6772e973fcd709ebacc010c71ab9bf3ea63acb8926cd8fb3e627cd98c05505240925705d60295fa7c0619f1928476e
|
7
|
+
data.tar.gz: 60e5d532f3ee97a3789ab30b9027b3f17e0e967eead46a64708df9706dca992eab8884b05f1f05b8eb3eaca7d9a799a4679f7cfb00b77be07e5b9625f618015e
|
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', '~> 1.7.0', 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
|
data/config/default.yml
CHANGED
@@ -18,7 +18,7 @@ AllCops:
|
|
18
18
|
ExtensionBinaries: []
|
19
19
|
# You can set up exclude pattens for all SketchUp departments.
|
20
20
|
Exclude: []
|
21
|
-
#
|
21
|
+
# Alternatively you can set up department wide exclusion.
|
22
22
|
SketchupBugs:
|
23
23
|
Exclude: []
|
24
24
|
SketchupDeprecations:
|
@@ -156,7 +156,7 @@ SketchupRequirements/ExtensionNamespace:
|
|
156
156
|
Description: Confine extensions to a single root namespace.
|
157
157
|
Details: >-
|
158
158
|
To avoid clashing with other extensions a single root namespace
|
159
|
-
should all the extension's code.
|
159
|
+
should contain all the extension's code.
|
160
160
|
Reference: https://github.com/SketchUp/rubocop-sketchup/tree/master/manual/cops_requirements.md#extensionnamespace
|
161
161
|
Exceptions: []
|
162
162
|
Enabled: true
|
data/lib/rubocop-sketchup.rb
CHANGED
@@ -39,7 +39,7 @@ end
|
|
39
39
|
|
40
40
|
# Make it easier to explore available methods on a method.
|
41
41
|
class Object
|
42
|
-
def methods!(queries = true)
|
42
|
+
def methods!(queries = true) # rubocop:disable Style/OptionalBooleanParameter
|
43
43
|
sorted = methods.sort - Object.class.instance_methods
|
44
44
|
sorted.reject! { |m| m.to_s.end_with?('?') } unless queries
|
45
45
|
sorted
|
data/lib/rubocop/sketchup/cop.rb
CHANGED
@@ -12,7 +12,7 @@ module RuboCop
|
|
12
12
|
# class will invoke the inherited hook instead
|
13
13
|
class << self
|
14
14
|
undef inherited
|
15
|
-
def inherited(*) end
|
15
|
+
def inherited(*) end # rubocop:disable Lint/MissingSuper
|
16
16
|
end
|
17
17
|
|
18
18
|
# Special case `Module#<` so that the rspec support rubocop exports
|
@@ -42,8 +42,16 @@ module RuboCop
|
|
42
42
|
|
43
43
|
include SketchUp::Config
|
44
44
|
|
45
|
+
SKETCHUP_DEPARTMENT_SEVERITY = {
|
46
|
+
SketchupRequirements: :error,
|
47
|
+
SketchupDeprecations: :warning,
|
48
|
+
SketchupPerformance: :warning,
|
49
|
+
SketchupBugs: :warning,
|
50
|
+
SketchupSuggestions: :convention,
|
51
|
+
}.freeze
|
52
|
+
|
45
53
|
# Invoke the original inherited hook so our cops are recognized
|
46
|
-
def self.inherited(subclass)
|
54
|
+
def self.inherited(subclass) # rubocop:disable Lint/MissingSuper
|
47
55
|
RuboCop::Cop::Cop.inherited(subclass)
|
48
56
|
end
|
49
57
|
|
@@ -58,16 +66,7 @@ module RuboCop
|
|
58
66
|
end
|
59
67
|
|
60
68
|
def sketchup_severity
|
61
|
-
|
62
|
-
when :SketchupRequirements
|
63
|
-
:error
|
64
|
-
when :SketchupDeprecations
|
65
|
-
:warning
|
66
|
-
when :SketchupPerformance
|
67
|
-
:warning
|
68
|
-
when :SketchupSuggestions
|
69
|
-
:convention
|
70
|
-
end
|
69
|
+
SKETCHUP_DEPARTMENT_SEVERITY[self.class.department]
|
71
70
|
end
|
72
71
|
|
73
72
|
def department_name
|
@@ -41,6 +41,62 @@ module RuboCop
|
|
41
41
|
|
42
42
|
FEATURES = [
|
43
43
|
|
44
|
+
{
|
45
|
+
version: 'SketchUp 2021.0',
|
46
|
+
types: {
|
47
|
+
class: [
|
48
|
+
'Sketchup::LayerFolder',
|
49
|
+
],
|
50
|
+
method: [
|
51
|
+
'Sketchup.redo',
|
52
|
+
'Sketchup::ComponentDefinition#live_component?',
|
53
|
+
'Sketchup::Layer#folder',
|
54
|
+
'Sketchup::Layer#folder=',
|
55
|
+
'Sketchup::LayerFolder#==',
|
56
|
+
'Sketchup::LayerFolder#add_folder',
|
57
|
+
'Sketchup::LayerFolder#add_layer',
|
58
|
+
'Sketchup::LayerFolder#count_folders',
|
59
|
+
'Sketchup::LayerFolder#count_layers',
|
60
|
+
'Sketchup::LayerFolder#display_name',
|
61
|
+
'Sketchup::LayerFolder#each',
|
62
|
+
'Sketchup::LayerFolder#each_folder',
|
63
|
+
'Sketchup::LayerFolder#each_layer',
|
64
|
+
'Sketchup::LayerFolder#folder',
|
65
|
+
'Sketchup::LayerFolder#folder=',
|
66
|
+
'Sketchup::LayerFolder#folders',
|
67
|
+
'Sketchup::LayerFolder#layers',
|
68
|
+
'Sketchup::LayerFolder#length',
|
69
|
+
'Sketchup::LayerFolder#name',
|
70
|
+
'Sketchup::LayerFolder#name=',
|
71
|
+
'Sketchup::LayerFolder#remove_folder',
|
72
|
+
'Sketchup::LayerFolder#remove_layer',
|
73
|
+
'Sketchup::LayerFolder#size',
|
74
|
+
'Sketchup::LayerFolder#visible=',
|
75
|
+
'Sketchup::LayerFolder#visible?',
|
76
|
+
'Sketchup::LayerFolder#visible_on_new_pages=',
|
77
|
+
'Sketchup::LayerFolder#visible_on_new_pages?',
|
78
|
+
'Sketchup::Layers#add_folder',
|
79
|
+
'Sketchup::Layers#count_folders',
|
80
|
+
'Sketchup::Layers#count_layers',
|
81
|
+
'Sketchup::Layers#each_folder',
|
82
|
+
'Sketchup::Layers#each_layer',
|
83
|
+
'Sketchup::Layers#folders',
|
84
|
+
'Sketchup::Layers#layers',
|
85
|
+
'Sketchup::Layers#purge_unused_folders',
|
86
|
+
'Sketchup::Layers#remove_folder',
|
87
|
+
'Sketchup::LayersObserver#onLayerFolderAdded',
|
88
|
+
'Sketchup::LayersObserver#onLayerFolderChanged',
|
89
|
+
'Sketchup::LayersObserver#onLayerFolderRemoved',
|
90
|
+
'Sketchup::LayersObserver#onParentFolderChanged',
|
91
|
+
'Sketchup::Page#layer_folders',
|
92
|
+
'Sketchup::Skp.read_guid',
|
93
|
+
],
|
94
|
+
module: [
|
95
|
+
'Sketchup::Skp',
|
96
|
+
],
|
97
|
+
},
|
98
|
+
},
|
99
|
+
|
44
100
|
{
|
45
101
|
version: 'LayOut 2020.1',
|
46
102
|
types: {
|
@@ -1137,6 +1193,8 @@ module RuboCop
|
|
1137
1193
|
add_classification
|
1138
1194
|
add_dimension_linear
|
1139
1195
|
add_dimension_radial
|
1196
|
+
add_folder
|
1197
|
+
add_layer
|
1140
1198
|
add_matchphoto_page
|
1141
1199
|
add_section_plane
|
1142
1200
|
aligned_text_position
|
@@ -1154,10 +1212,14 @@ module RuboCop
|
|
1154
1212
|
colorize_deltas
|
1155
1213
|
colorize_type
|
1156
1214
|
colorize_type=
|
1215
|
+
count_folders
|
1216
|
+
count_layers
|
1157
1217
|
count_used_instances
|
1158
1218
|
dash_scale
|
1159
1219
|
days_remaining
|
1160
1220
|
drawing_element_visible?
|
1221
|
+
each_folder
|
1222
|
+
each_layer
|
1161
1223
|
edit_transform
|
1162
1224
|
effects_modified?
|
1163
1225
|
end_attached_to
|
@@ -1188,6 +1250,7 @@ module RuboCop
|
|
1188
1250
|
instance_path_from_pid_path
|
1189
1251
|
is_polygon?
|
1190
1252
|
large_icon
|
1253
|
+
layer_folders
|
1191
1254
|
layers_modified?
|
1192
1255
|
leader_break_point
|
1193
1256
|
leader_break_point=
|
@@ -1195,6 +1258,7 @@ module RuboCop
|
|
1195
1258
|
line_style
|
1196
1259
|
line_style=
|
1197
1260
|
line_styles
|
1261
|
+
live_component?
|
1198
1262
|
load_from_url
|
1199
1263
|
load_on_start?
|
1200
1264
|
load_schema
|
@@ -1221,6 +1285,7 @@ module RuboCop
|
|
1221
1285
|
persistent_id_path
|
1222
1286
|
refresh_thumbnail
|
1223
1287
|
remove_classification
|
1288
|
+
remove_folder
|
1224
1289
|
reset_camera
|
1225
1290
|
reset_effects
|
1226
1291
|
reset_layers
|
@@ -1251,6 +1316,8 @@ module RuboCop
|
|
1251
1316
|
unload_schema
|
1252
1317
|
upper_left
|
1253
1318
|
upper_right
|
1319
|
+
visible_on_new_pages?
|
1320
|
+
visible_on_new_pages=
|
1254
1321
|
winding
|
1255
1322
|
window_pick
|
1256
1323
|
].freeze
|
@@ -1263,6 +1330,10 @@ module RuboCop
|
|
1263
1330
|
onElementModified
|
1264
1331
|
onExplode
|
1265
1332
|
onLayerChanged
|
1333
|
+
onLayerFolderAdded
|
1334
|
+
onLayerFolderChanged
|
1335
|
+
onLayerFolderRemoved
|
1336
|
+
onParentFolderChanged
|
1266
1337
|
onPidChanged
|
1267
1338
|
onPlaceComponent
|
1268
1339
|
onPostSaveModel
|
@@ -17,9 +17,10 @@ module RuboCop
|
|
17
17
|
# @param [Integer, Float] version
|
18
18
|
# @param [Integer] maintenance
|
19
19
|
def initialize(*args)
|
20
|
-
|
20
|
+
case args.size
|
21
|
+
when 1
|
21
22
|
@version, @maintenance = parse_version(args.first)
|
22
|
-
|
23
|
+
when 2
|
23
24
|
validate(args)
|
24
25
|
@version, @maintenance = args
|
25
26
|
else
|
@@ -66,6 +67,7 @@ module RuboCop
|
|
66
67
|
#
|
67
68
|
# The second item in the array is maintenance annotation
|
68
69
|
VALID_VERSIONS = [
|
70
|
+
[2021.0, 0],
|
69
71
|
[2020.1, 0],
|
70
72
|
[2020.0, 0],
|
71
73
|
[2019.2, 0],
|
@@ -93,7 +95,8 @@ module RuboCop
|
|
93
95
|
def parse_version(version)
|
94
96
|
v = 0
|
95
97
|
m = 0
|
96
|
-
|
98
|
+
case version
|
99
|
+
when String
|
97
100
|
# Treat all LayOut versions as SketchUp versions for now.
|
98
101
|
normalized_version = version.gsub('LayOut', 'SketchUp')
|
99
102
|
result = normalized_version.match(VERSION_NUMBER_REGEX)
|
@@ -101,7 +104,7 @@ module RuboCop
|
|
101
104
|
v = result.captures[0].to_f
|
102
105
|
m = (result.captures[1] || '0').to_i
|
103
106
|
end
|
104
|
-
|
107
|
+
when Numeric
|
105
108
|
v = version
|
106
109
|
m = 0
|
107
110
|
end
|
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.93'
|
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.18.0
|
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-11-18 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.93'
|
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.93'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,7 +137,7 @@ 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
|
- - ">="
|